added weak list to ldap-session type

This commit is contained in:
eknauel 2004-04-15 13:52:35 +00:00
parent ec7a66d221
commit e0ca103bd4
1 changed files with 25 additions and 2 deletions

View File

@ -1,12 +1,35 @@
;;; weak lists
(define (cons-weak obj list)
(cons (make-weak-pointer obj) list))
(define (filter-collected list)
(filter (lambda (weak-pointer)
(not (weak-pointer-ref weak-pointer)))
list))
;;; ldap-session
(define-record-type ldap-session :ldap-session
(make-ldap-session c-pointer bound? options)
(make-ldap-session c-pointer bound? options weak-list)
ldap-session?
(c-pointer ldap-session-c-pointer)
(bound? ldap-session-bound? set-ldap-session-bound?!)
(options ldap-session-options set-ldap-session-options!))
(options ldap-session-options set-ldap-session-options!)
(weak-list ldap-session-weak-list set-ldap-session-weak-list!))
(define (ldap-session-weak-list-add! session thing)
(set-ldap-session-weak-list!
session (cons-weak thing (ldap-session-weak-list session))))
(define (ldap-session-weak-list-filter! session)
(set-ldap-session-weak-list!
session (filter-collected (ldap-session-weak-list session))))
(define-exported-binding "ldap-session" :ldap-session)
;;; ldap session options
(define-record-type session-options :session-options
(make-session-options implicit-unbind-ok? auto-unbind?)
session-options?