]> gitweb @ CieloNegro.org - bindings-apr-util.git/commitdiff
Bindings.APR.SHA1
authorPHO <pho@cielonegro.org>
Thu, 23 Sep 2010 13:47:39 +0000 (22:47 +0900)
committerPHO <pho@cielonegro.org>
Thu, 23 Sep 2010 13:47:39 +0000 (22:47 +0900)
Bindings/APR/SHA1.hsc [new file with mode: 0644]
bindings-apr-util.cabal
cbits/helper_apr_sha1.c [new file with mode: 0644]

diff --git a/Bindings/APR/SHA1.hsc b/Bindings/APR/SHA1.hsc
new file mode 100644 (file)
index 0000000..cf9d7cf
--- /dev/null
@@ -0,0 +1,26 @@
+#include <bindings.dsl.h>
+#include <apr_sha1.h>
+
+module Bindings.APR.SHA1 where
+#strict_import
+import Bindings.APR
+
+#num APR_SHA1_DIGESTSIZE
+
+#globalarray APR_SHA1_ID, CChar
+
+#num APR_SHA1PW_IDLEN
+
+#starttype struct apr_sha1_ctx_t
+#  array_field digest  , <apr_uint32_t>
+#  field       count_lo, <apr_uint32_t>
+#  field       count_hi, <apr_uint32_t>
+#  array_field data    , <apr_uint32_t>
+#  field       local   , CInt
+#stoptype
+
+#ccall apr_sha1_base64       , Ptr CChar -> CInt -> Ptr CChar -> IO ()
+#ccall apr_sha1_init         , Ptr <apr_sha1_ctx_t> -> IO ()
+#ccall apr_sha1_update       , Ptr <apr_sha1_ctx_t> -> Ptr CChar -> CUInt -> IO ()
+#ccall apr_sha1_update_binary, Ptr <apr_sha1_ctx_t> -> Ptr CUInt -> CUInt -> IO ()
+#ccall apr_sha1_final        , Ptr CUChar -> Ptr <apr_sha1_ctx_t> -> IO ()
index 052cd4cb8cc44118c7e96e7ab7c6def55185fe80..9b5aed583d696a12a5af29440c872148ad981e26 100644 (file)
@@ -49,6 +49,7 @@ Library
         Bindings.APR.RMM
         Bindings.APR.ResList
         Bindings.APR.SDBM
+        Bindings.APR.SHA1
         Bindings.APR.XLate
 
     C-Sources:
@@ -59,6 +60,7 @@ Library
         cbits/helper_apr_ldap_init.c
         cbits/helper_apr_md4.c
         cbits/helper_apr_sdbm.c
+        cbits/helper_apr_sha1.c
 
     Extensions:
         ForeignFunctionInterface
diff --git a/cbits/helper_apr_sha1.c b/cbits/helper_apr_sha1.c
new file mode 100644 (file)
index 0000000..8fae529
--- /dev/null
@@ -0,0 +1,4 @@
+#include <bindings.cmacros.h>
+#include <apr_sha1.h>
+
+BC_GLOBALARRAY(APR_SHA1PW_ID, char)