92 lines
2.9 KiB
Scheme
92 lines
2.9 KiB
Scheme
(define-record-type ldap-session :ldap-session
|
|
(make-ldap-session c-pointer bound? options)
|
|
ldap-session?
|
|
(c-pointer ldap-session-c-pointer)
|
|
(bound? ldap-session-bound? set-ldap-session-bound?!)
|
|
(options ldap-session-options set-ldap-session-options!))
|
|
|
|
(define-exported-binding "ldap-session" :ldap-session)
|
|
|
|
(define-record-type session-options :session-options
|
|
(make-session-options implicit-unbind-ok? auto-unbind?)
|
|
session-options?
|
|
(implicit-unbind-ok? session-options-implicit-unbind-ok?)
|
|
(auto-unbind? session-options-auto-unbind?))
|
|
|
|
(define (ldap-session-implicit-unbind-ok? session)
|
|
(session-options-implicit-unbind-ok? (ldap-session-options session)))
|
|
|
|
(define (ldap-session-auto-unbind? session)
|
|
(session-options-auto-unbind? (ldap-session-options session)))
|
|
|
|
(define (ldap-session=? session-a session-b)
|
|
(equal? (ldap-session-c-pointer session-a)
|
|
(ldap-session-c-pointer session-b)))
|
|
|
|
;;; This is the basic type
|
|
(define-record-type ldap-message :ldap-message
|
|
(make-ldap-message c-pointer session result)
|
|
ldap-message?
|
|
(c-pointer ldap-message-c-pointer)
|
|
;; the following fields are needed to implement automatic
|
|
;; deallocation of ldap structures in C code
|
|
(session ldap-message-session set-ldap-message-session!)
|
|
(result ldap-message-result set-ldap-message-result!))
|
|
|
|
(define-exported-binding "ldap-message" :ldap-message)
|
|
|
|
(define (ldap-message=? session-a session-b)
|
|
(equal? (ldap-message-c-pointer session-a)
|
|
(ldap-message-c-pointer session-b)))
|
|
|
|
(define-record-type ldap-modification :ldap-modification
|
|
(make-ldap-modification c-pointer)
|
|
ldap-modification?
|
|
(c-pointer ldap-modification-c-pointer))
|
|
|
|
(define-exported-binding "ldap-modification" :ldap-modification)
|
|
|
|
(define-record-type ldap-api-info :ldap-api-info
|
|
(make-ldap-api-info c-pointer)
|
|
ldap-api-info?
|
|
(c-pointer ldap-api-info-c-pointer))
|
|
|
|
(define-exported-binding "ldap-api-info" :ldap-api-info)
|
|
|
|
(import-lambda-definition ldap-api-info-info-version
|
|
(ldap-ai)
|
|
"scsh_ldapapiinfo_get_info_version")
|
|
|
|
(import-lambda-definition ldap-api-info-api-version
|
|
(ldap-ai)
|
|
"scsh_ldapapiinfo_get_api_version")
|
|
|
|
(import-lambda-definition ldap-api-info-protocol-version
|
|
(ldap-ai)
|
|
"scsh_ldapapiinfo_get_protocol_version")
|
|
|
|
(import-lambda-definition ldap-api-info-vendor-name
|
|
(ldap-ai)
|
|
"scsh_ldapapiinfo_get_vendor_name")
|
|
|
|
(import-lambda-definition ldap-api-info-vendor-version
|
|
(ldap-ai)
|
|
"scsh_ldapapiinfo_get_vendor_version")
|
|
|
|
(define-record-type ber-element :ber-element
|
|
(make-ber-element c-pointer)
|
|
ber-element?
|
|
(c-pointer ber-element-c-pointer))
|
|
|
|
(define-exported-binding "ber-element" :ber-element)
|
|
|
|
(define (ldap-success? obj)
|
|
(equal? (ldap-return success) obj))
|
|
|
|
(define convert-ldap-return-code
|
|
(make-finite-type-import-function 'ldap-return ldap-return-elements ldap-return-id))
|
|
|
|
(define convert-ldap-message-type
|
|
(make-finite-type-import-function
|
|
'ldap-message-types ldap-message-types-elements ldap-message-types-id))
|