+ added: ldap-scope-arguments, ldap-attribute-selectors, ldap-session-options

This commit is contained in:
eknauel 2004-01-08 07:44:15 +00:00
parent 5b9e04b8d0
commit c25ef694b2
1 changed files with 47 additions and 3 deletions

View File

@ -5,7 +5,7 @@
(define-structure ldap-constants ldap-constants-interface
(open
scheme signals
scheme signals srfi-13
ffi-import-constants)
(begin
@ -74,9 +74,40 @@
(map make-constant-from-c-name-integer
'("LDAP_VERSION" "LDAP_VERSION3")))
(define ldap-scope-arguments
(map make-constant-from-c-name-integer
'("LDAP_SCOPE_BASE" "LDAP_SCOPE_ONELEVEL" "LDAP_SCOPE_SUBTREE")))
(define ldap-session-options
(map make-constant-from-c-name-integer
'("LDAP_OPT_API_INFO"
"LDAP_OPT_DEREF"
"LDAP_OPT_SIZELIMIT"
"LDAP_OPT_TIMELIMIT"
"LDAP_OPT_REFERRALS"
"LDAP_OPT_RESTART"
"LDAP_OPT_PROTOCOL_VERSION"
"LDAP_OPT_SERVER_CONTROLS"
"LDAP_OPT_CLIENT_CONTROLS"
"LDAP_OPT_API_FEATURE_INFO"
"LDAP_OPT_HOST_NAME"
"LDAP_OPT_ERROR_NUMBER"
"LDAP_OPT_ERROR_STRING"
"LDAP_OPT_MATCHED_DN")))
(define ldap-attribute-selectors
(list
(make-string-constant
"LDAP_NO_ATTRS" "ldap-attributes-no-attribute")
(make-string-constant
"LDAP_ALL_USER_ATTRIBUTES" "ldap-attributes-all-user-attributes")))
(define ldap-all-constants
(append ldap-return-codes
ldap-opt-protocol-version))
ldap-opt-protocol-version
ldap-scope-arguments
ldap-attribute-selectors
ldap-session-options))
(define (write-source-file name string)
(call-with-output-file name
@ -105,12 +136,25 @@
(write-source-file
(string-append path "/const-gen.scm")
(string-append
(generate-finite-type-definition
"ldap-return" (make-drop-common-prefix-name-converter "LDAP_")
ldap-return-codes)
(generate-finite-type-definition
"ldap-option-version" (make-drop-common-prefix-name-converter "LDAP_")
ldap-opt-protocol-version))))
ldap-opt-protocol-version)
(generate-finite-type-definition
"ldap-scope-arguments" (make-drop-common-prefix-name-converter "LDAP_SCOPE_")
ldap-scope-arguments)
(generate-finite-type-definition
"ldap-session-options" (make-drop-common-prefix-name-converter "LDAP_OPT_")
ldap-session-options)
(string-join
(map generate-binding ldap-attribute-selectors)))))
(define (make-c-files args)
(if (null? args)