]> gitweb @ CieloNegro.org - bindings-apr-util.git/commitdiff
Bindings.APR.LDAP.Init and Option
authorPHO <pho@cielonegro.org>
Sun, 12 Sep 2010 02:08:17 +0000 (11:08 +0900)
committerPHO <pho@cielonegro.org>
Sun, 12 Sep 2010 02:08:17 +0000 (11:08 +0900)
Bindings/APR/LDAP.hsc
Bindings/APR/LDAP/Init.hsc [new file with mode: 0644]
Bindings/APR/LDAP/Option.hsc [new file with mode: 0644]
bindings-apr-util.cabal
cbits/helper_apr_ldap.c [new file with mode: 0644]
cbits/helper_apr_ldap_init.c [new file with mode: 0644]

index 8792eedc406e13b25b679dfc28f4e79e253a7d70..95f359d6ccf48a683b6649f8a5cd8164bb557de3 100644 (file)
@@ -21,6 +21,8 @@ module Bindings.APR.LDAP where
 #  num APR_HAS_LDAP_SSL
 #  num APR_HAS_LDAP_URL_PARSE
 
+#  opaque_t LDAP
+
 #  num APR_HAS_LDAPSSL_CLIENT_INIT
 #  num APR_HAS_LDAPSSL_CLIENT_DEINIT
 #  num APR_HAS_LDAPSSL_ADD_TRUSTED_CERT
@@ -37,7 +39,6 @@ module Bindings.APR.LDAP where
 #    field rc    , CInt
 #  stoptype
 
--- FIXME What's the type it takes?
--- #  cinline APR_LDAP_IS_SERVER_DOWN, <unknown> -> IO CInt
+#  cinline APR_LDAP_IS_SERVER_DOWN, CInt -> IO CInt
 
 #endif
\ No newline at end of file
diff --git a/Bindings/APR/LDAP/Init.hsc b/Bindings/APR/LDAP/Init.hsc
new file mode 100644 (file)
index 0000000..381d297
--- /dev/null
@@ -0,0 +1,19 @@
+#include <bindings.dsl.h>
+#include <apr_ldap_init.h>
+
+module Bindings.APR.LDAP.Init where
+#strict_import
+import Bindings.APR.LDAP
+import Bindings.APR.Pools
+
+#if APR_HAS_LDAP
+
+#  num APU_LDAP_INSUFFICIENT_ACCESS
+#  cinline APU_LDAP_SECURITY_ERROR, CInt -> IO CInt
+
+#  ccall apr_ldap_ssl_init  , Ptr <apr_pool_t> -> Ptr CChar -> CInt -> Ptr (Ptr <apr_ldap_err_t>) -> IO CInt
+#  ccall apr_ldap_ssl_deinit, IO CInt
+#  ccall apr_ldap_init      , Ptr <apr_pool_t> -> Ptr (Ptr <LDAP>) -> Ptr CChar -> CInt -> CInt -> Ptr (Ptr <apr_ldap_err_t>) -> IO CInt
+#  ccall apr_ldap_info      , Ptr <apr_pool_t> -> Ptr (Ptr <apr_ldap_err_t>) -> IO CInt
+
+#endif
diff --git a/Bindings/APR/LDAP/Option.hsc b/Bindings/APR/LDAP/Option.hsc
new file mode 100644 (file)
index 0000000..e8b2995
--- /dev/null
@@ -0,0 +1,47 @@
+#include <bindings.dsl.h>
+#include <apr_ldap_option.h>
+
+module Bindings.APR.LDAP.Option where
+#strict_import
+import Bindings.APR.LDAP
+import Bindings.APR.Pools
+
+#if APR_HAS_LDAP
+
+#  num APR_LDAP_OPT_TLS
+#  num APR_LDAP_OPT_TLS_CERT
+#  num APR_LDAP_OPT_VERIFY_CERT
+#  num APR_LDAP_OPT_REFERRALS
+#  num APR_LDAP_OPT_REFHOPLIMIT
+
+#  num APR_LDAP_CA_TYPE_UNKNOWN
+#  num APR_LDAP_CA_TYPE_DER
+#  num APR_LDAP_CA_TYPE_BASE64
+#  num APR_LDAP_CA_TYPE_SECMOD
+#  num APR_LDAP_CERT_TYPE_UNKNOWN
+#  num APR_LDAP_CERT_TYPE_DER
+#  num APR_LDAP_CERT_TYPE_BASE64
+#  num APR_LDAP_CERT_TYPE_KEY3_DB
+#  num APR_LDAP_CERT_TYPE_NICKNAME
+#  num APR_LDAP_KEY_TYPE_UNKNOWN
+#  num APR_LDAP_KEY_TYPE_DER
+#  num APR_LDAP_KEY_TYPE_BASE64
+#  num APR_LDAP_CERT_TYPE_PFX
+#  num APR_LDAP_KEY_TYPE_PFX
+#  num APR_LDAP_CA_TYPE_CACERTDIR_BASE64
+
+#  starttype struct apr_ldap_opt_tls_cert_t
+#    field type    , CInt
+#    field path    , Ptr CChar
+#    field password, Ptr CChar
+#  stoptype
+
+#  num APR_LDAP_NONE
+#  num APR_LDAP_SSL
+#  num APR_LDAP_STARTTLS
+#  num APR_LDAP_STOPTLS
+
+#  ccall apr_ldap_get_option, Ptr <apr_pool_t> -> Ptr <LDAP> -> CInt -> Ptr () -> Ptr (Ptr <apr_ldap_err_t>) -> IO CInt
+#  ccall apr_ldap_set_option, Ptr <apr_pool_t> -> Ptr <LDAP> -> CInt -> Ptr () -> Ptr (Ptr <apr_ldap_err_t>) -> IO CInt
+
+#endif
\ No newline at end of file
index 2fa2cb66ff278d3941fe42f7de1b1f231decf5df..f78eb548b229172e0e00f2cac87e837ea16ba501 100644 (file)
@@ -38,11 +38,15 @@ Library
         Bindings.APR.DBM
         Bindings.APR.Hooks
         Bindings.APR.LDAP
+        Bindings.APR.LDAP.Init
+        Bindings.APR.LDAP.Option
 
     C-Sources:
         cbits/helper_apr_anylock.c
         cbits/helper_apr_buckets.c
         cbits/helper_apr_dbm.c
+        cbits/helper_apr_ldap.c
+        cbits/helper_apr_ldap_init.c
 
     Extensions:
         ForeignFunctionInterface
diff --git a/cbits/helper_apr_ldap.c b/cbits/helper_apr_ldap.c
new file mode 100644 (file)
index 0000000..17ec871
--- /dev/null
@@ -0,0 +1,4 @@
+#include <bindings.cmacros.h>
+#include <apr_ldap.h>
+
+BC_INLINE1(APR_LDAP_IS_SERVER_DOWN, int, int)
diff --git a/cbits/helper_apr_ldap_init.c b/cbits/helper_apr_ldap_init.c
new file mode 100644 (file)
index 0000000..df05edd
--- /dev/null
@@ -0,0 +1,4 @@
+#include <bindings.cmacros.h>
+#include <apr_ldap.h>
+
+BC_INLINE1(APU_LDAP_SECURITY_ERROR, int, int)