]> gitweb @ CieloNegro.org - bindings-apr-util.git/commitdiff
Bindings.APR.MD4 and XLate
authorPHO <pho@cielonegro.org>
Tue, 21 Sep 2010 05:55:20 +0000 (14:55 +0900)
committerPHO <pho@cielonegro.org>
Tue, 21 Sep 2010 05:55:20 +0000 (14:55 +0900)
Bindings/APR/MD4.hsc [new file with mode: 0644]
Bindings/APR/XLate.hsc [new file with mode: 0644]
bindings-apr-util.cabal
cbits/helper_apr_md4.c [new file with mode: 0644]

diff --git a/Bindings/APR/MD4.hsc b/Bindings/APR/MD4.hsc
new file mode 100644 (file)
index 0000000..ac3b86f
--- /dev/null
@@ -0,0 +1,25 @@
+#include <bindings.dsl.h>
+#include <apr_md4.h>
+
+module Bindings.APR.MD4 where
+#strict_import
+import Bindings.APR
+import Bindings.APR.ErrNo
+import Bindings.APR.XLate
+
+#num APR_MD4_DIGESTSIZE
+
+#starttype struct apr_md4_ctx_t
+#  array_field state , <apr_uint32_t>
+#  array_field count , <apr_uint32_t>
+#  array_field buffer, CUChar
+#  if APR_HAS_XLATE
+#    field xlate, Ptr <apr_xlate_t>
+#  endif
+#stoptype
+
+#ccall   apr_md4_init     , Ptr <apr_md4_ctx_t> -> IO <apr_status_t>
+#cinline apr_md4_set_xlate, Ptr <apr_md4_ctx_t> -> Ptr <apr_xlate_t> -> IO <apr_status_t>
+#ccall   apr_md4_update   , Ptr <apr_md4_ctx_t> -> Ptr CUChar -> <apr_size_t> -> IO <apr_status_t>
+#ccall   apr_md4_final    , Ptr CUChar -> Ptr <apr_md4_ctx_t> -> IO <apr_status_t>
+#ccall   apr_md4          , Ptr CUChar -> Ptr CUChar -> <apr_size_t> -> IO <apr_status_t>
diff --git a/Bindings/APR/XLate.hsc b/Bindings/APR/XLate.hsc
new file mode 100644 (file)
index 0000000..415886f
--- /dev/null
@@ -0,0 +1,25 @@
+#include <bindings.dsl.h>
+#include <apr_xlate.h>
+
+module Bindings.APR.XLate where
+#strict_import
+import Bindings.APR
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+
+#opaque_t apr_xlate_t
+
+#ccall apr_xlate_open, Ptr (Ptr <apr_xlate_t>) -> Ptr CChar -> Ptr CChar -> Ptr <apr_pool_t> -> IO <apr_status_t>
+
+#pointer APR_DEFAULT_CHARSET
+#pointer APR_LOCALE_CHARSET
+
+#ccall apr_xlate_sb_get     , Ptr <apr_xlate_t> -> Ptr CInt -> IO <apr_status_t>
+#ccall apr_xlate_conv_buffer, Ptr <apr_xlate_t> -> Ptr CChar -> Ptr <apr_size_t> -> Ptr CChar -> Ptr <apr_size_t> -> IO <apr_status_t>
+
+#if APR_NOT_DONE_YET
+#  ccall apr_xlate_conv_char, Ptr <apr_xlate_t> -> CChar -> CChar -> IO <apr_status_t>
+#endif
+
+#ccall apr_xlate_conv_byte  , Ptr <apr_xlate_t> -> CUChar -> IO <apr_int32_t>
+#ccall apr_xlate_close      , Ptr <apr_xlate_t> -> IO <apr_status_t>
index 75e662cf1910e4689230131cb804aeeb2c565652..f8e900ecbf01136873a062d31c214e5f2f0c23b6 100644 (file)
@@ -42,6 +42,8 @@ Library
         Bindings.APR.LDAP.Option
         Bindings.APR.LDAP.Rebind
         Bindings.APR.LDAP.URL
+        Bindings.APR.MD4
+        Bindings.APR.XLate
 
     C-Sources:
         cbits/helper_apr_anylock.c
@@ -49,6 +51,7 @@ Library
         cbits/helper_apr_dbm.c
         cbits/helper_apr_ldap.c
         cbits/helper_apr_ldap_init.c
+        cbits/helper_apr_md4.c
 
     Extensions:
         ForeignFunctionInterface
diff --git a/cbits/helper_apr_md4.c b/cbits/helper_apr_md4.c
new file mode 100644 (file)
index 0000000..649985e
--- /dev/null
@@ -0,0 +1,4 @@
+#include <bindings.cmacros.h>
+#include <apr_md4.h>
+
+BC_INLINE2(apr_md4_set_xlate, apr_md4_ctx_t*, apr_xlate_t*, apr_status_t)