]> gitweb @ CieloNegro.org - bindings-apr.git/commitdiff
more bindings
authorPHO <pho@cielonegro.org>
Sun, 8 Aug 2010 15:42:30 +0000 (00:42 +0900)
committerPHO <pho@cielonegro.org>
Sun, 8 Aug 2010 15:42:30 +0000 (00:42 +0900)
Bindings/APR/FNMatch.hsc [new file with mode: 0644]
Bindings/APR/General.hsc [new file with mode: 0644]
bindings-apr.cabal
cbits/helper_apr_general.c [new file with mode: 0644]

diff --git a/Bindings/APR/FNMatch.hsc b/Bindings/APR/FNMatch.hsc
new file mode 100644 (file)
index 0000000..50d63dd
--- /dev/null
@@ -0,0 +1,19 @@
+#include <bindings.dsl.h>
+#include <apr_fnmatch.h>
+
+module Bindings.APR.FNMatch where
+#strict_import
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+import Bindings.APR.Tables
+
+#num APR_FNM_NOMATCH
+
+#num APR_FNM_NOESCAPE
+#num APR_FNM_PATHNAME
+#num APR_FNM_PERIOD
+#num APR_FNM_CASE_BLIND
+
+#ccall apr_fnmatch     , Ptr CChar -> Ptr CChar -> CInt -> IO <apr_status_t>
+#ccall apr_fnmatch_test, Ptr CChar -> IO CInt
+#ccall apr_match_glob  , Ptr CChar -> Ptr (Ptr <apr_array_header_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
diff --git a/Bindings/APR/General.hsc b/Bindings/APR/General.hsc
new file mode 100644 (file)
index 0000000..b28bcb6
--- /dev/null
@@ -0,0 +1,39 @@
+#include <bindings.dsl.h>
+#include <apr_general.h>
+
+module Bindings.APR.General where
+#strict_import
+import Bindings.APR
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+
+#num FALSE
+#num TRUE
+
+#num APR_ASCII_BLANK
+#num APR_ASCII_CR
+#num APR_ASCII_LF
+#num APR_ASCII_TAB
+
+#integral_t apr_signum_t
+
+-- It's impossible to wrap around APR_OFFSET() and APR_OFFSET_OF().
+
+#cinline strcasecmp , Ptr CChar -> Ptr CChar -> IO CInt
+#cinline strncasecmp, Ptr CChar -> Ptr CChar -> CSize -> IO CInt
+
+-- What's the correct type for these macros?
+#cinline APR_ALIGN, <apr_uint64_t> -> <apr_uint64_t> -> IO <apr_uint64_t>
+#cinline APR_ALIGN_DEFAULT, <apr_uint64_t> -> IO <apr_uint64_t>
+
+#cinline memmove, Ptr () -> Ptr () -> CSize -> IO (Ptr ())
+#cinline memchr , Ptr () -> CInt -> CSize -> IO (Ptr ())
+
+#ccall apr_initialize    , IO <apr_status_t>
+#ccall apr_app_initialize, Ptr CInt -> Ptr (Ptr (Ptr CChar)) -> Ptr (Ptr (Ptr CChar)) -> IO <apr_status_t>
+#ccall apr_terminate     , IO ()
+#ccall apr_terminate2    , IO ()
+
+#if APR_HAS_RANDOM
+#ccall apr_generate_random_bytes, Ptr CUChar -> <apr_size_t> -> IO <apr_status_t>
+#endif
index 75436cd25667b7b9b2d4774c85765359ab6aee2c..6b312d1b7beea01a6eb3249cff8ec39f110efe2c 100644 (file)
@@ -39,6 +39,8 @@ Library
         Bindings.APR.File.IO
         Bindings.APR.File.Info
         Bindings.APR.File.Types
         Bindings.APR.File.IO
         Bindings.APR.File.Info
         Bindings.APR.File.Types
+        Bindings.APR.FNMatch
+        Bindings.APR.General
         Bindings.APR.Pools
         Bindings.APR.Proc.Mutex
         Bindings.APR.Tables
         Bindings.APR.Pools
         Bindings.APR.Proc.Mutex
         Bindings.APR.Tables
@@ -51,6 +53,7 @@ Library
     C-Sources:
 --        cbits/helper_apr_anylock.c
         cbits/helper_apr_errno.c
     C-Sources:
 --        cbits/helper_apr_anylock.c
         cbits/helper_apr_errno.c
+        cbits/helper_apr_general.c
         cbits/helper_apr_pools.c
         cbits/helper_apr_time.c
         cbits/helper_apr_user.c
         cbits/helper_apr_pools.c
         cbits/helper_apr_time.c
         cbits/helper_apr_user.c
diff --git a/cbits/helper_apr_general.c b/cbits/helper_apr_general.c
new file mode 100644 (file)
index 0000000..a823f11
--- /dev/null
@@ -0,0 +1,11 @@
+#include <bindings.cmacros.h>
+#include <apr_general.h>
+
+BC_INLINE2(strcasecmp , const char*, const char*, int)
+BC_INLINE3(strncasecmp, const char*, const char*, size_t, int)
+
+BC_INLINE2(APR_ALIGN, apr_uint64_t, apr_uint64_t, apr_uint64_t)
+BC_INLINE1(APR_ALIGN_DEFAULT, apr_uint64_t, apr_uint64_t)
+
+BC_INLINE3(memmove, void*, const void*, size_t, void*)
+BC_INLINE3(memchr , const void*, int, size_t, void*)