scsh-ldap/scheme/ldap.scm

60 lines
1.4 KiB
Scheme
Raw Normal View History

2003-10-28 10:27:54 -05:00
(define-record-type ldap :ldap
(make-ldap c-pointer)
ldap?
(c-pointer ldap-c-pointer))
(define-exported-binding "ldap" :ldap)
(define-record-type ldap-message :ldap-message
(make-ldap-message c-pointer)
ldap-message?
(c-pointer ldap-message-c-pointer))
(define-exported-binding "ldap-message" :ldap-message)
(define (ldap-open host port)
(let ((ldap (ldap-open-internal host port)))
(if ldap (add-finalizer! ldap ldap-memfree))
ldap))
(define (ldap-init host port)
(let ((ldap (ldap-init-internal host port)))
(if ldap (add-finalizer! ldap ldap-memfree))
ldap))
(import-lambda-definition ldap-open-internal
(host port)
"scsh_ldap_open")
(import-lambda-definition ldap-init-internal
(host port)
"scsh_ldap_init")
(import-lambda-definition ldap-bind-sync
(ldap user password method)
"scsh_ldap_bind_s")
(import-lambda-definition ldap-simple-bind-sync
(ldap user password)
"scsh_ldap_simple_bind_s")
(import-lambda-definition ldap-unbind-sync
(ldap)
"scsh_ldap_unbind_s")
(import-lambda-definition ldap-error-string
(error-code)
"scsh_ldap_error_string")
(import-lambda-definition ldap-result-error
(ldap result)
"scsh_ldap_result_error")
(import-lambda-definition ldap-memfree
(ldap)
"scsh_ldap_memfree")
(import-lambda-definition ldap-msgfree
(ldap)
"scsh_ldap_msgfree")