From 1bd017ab9b8fbda671610cb579cf5bae7b98be5f Mon Sep 17 00:00:00 2001 From: eknauel Date: Wed, 11 Feb 2004 12:46:39 +0000 Subject: [PATCH] + Call scsh_ldap_constants_export_bindings() during init + minor changes --- c/ldap.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/c/ldap.c b/c/ldap.c index 649431b..144101a 100644 --- a/c/ldap.c +++ b/c/ldap.c @@ -48,9 +48,9 @@ s48_value scsh_ldap_init(s48_value host, s48_value port) ldap = ldap_init(s48_extract_string(host), s48_extract_integer(port)); S48_GC_UNPROTECT(); if (ldap == NULL) - s48_raise_os_error(errno); + s48_raise_os_error(errno); else - scsh_enter_ldap(ldap); + return scsh_enter_ldap(ldap); } s48_value scsh_ldap_simple_bind_s(s48_value ldap, s48_value user, s48_value cred) @@ -657,7 +657,8 @@ void scsh_init_ldap_bindings(void) { ffit_init_hook(); - scsh_ldap_gc_protect_globals(); + scsh_ldap_gc_protect_globals(); /* generated by ffi-tools */ + S48_GC_PROTECT_GLOBAL(condition_ldap_memory_alloc_error); S48_GC_PROTECT_GLOBAL(condition_ldap_feature_not_supported); S48_GC_PROTECT_GLOBAL(condition_ldap_read_only_option); @@ -669,19 +670,21 @@ void scsh_init_ldap_bindings(void) condition_ldap_read_only_option = s48_get_imported_binding("condition-ldap-read-only-option"); - scsh_ldap_enter_ldap_constants(); - FFIT_RECORD_TYPE_INIT(scsh_ldap_record_type, ldap); - FFIT_RECORD_TYPE_INIT(scsh_ldapmessage_record_type, ldap-message); - FFIT_RECORD_TYPE_INIT(scsh_ldapmod_record_type, ldap-modification); + scsh_ldap_enter_ldap_constants(); /* generated by ffi-tools */ + scsh_ldap_constants_export_bindings(); /* generated by ffi-tools */ - FFIT_RECORD_TYPE_INIT(scsh_ldapapiinfo_record_type, ldap-api-info); + FFIT_RECORD_TYPE_INIT(scsh_ldap_record_type, "ldap-session"); + FFIT_RECORD_TYPE_INIT(scsh_ldapmessage_record_type, "ldap-message"); + FFIT_RECORD_TYPE_INIT(scsh_ldapmod_record_type, "ldap-modification"); + + FFIT_RECORD_TYPE_INIT(scsh_ldapapiinfo_record_type, "ldap-api-info"); S48_EXPORT_FUNCTION(scsh_ldapapiinfo_get_info_version); S48_EXPORT_FUNCTION(scsh_ldapapiinfo_get_protocol_version); S48_EXPORT_FUNCTION(scsh_ldapapiinfo_get_vendor_name); S48_EXPORT_FUNCTION(scsh_ldapapiinfo_get_vendor_version); S48_EXPORT_FUNCTION(scsh_ldapapiinfo_get_extensions); - FFIT_RECORD_TYPE_INIT(scsh_berelement_record_type, ber-element); + FFIT_RECORD_TYPE_INIT(scsh_berelement_record_type, "ber-element"); S48_EXPORT_FUNCTION(scsh_ldap_init); S48_EXPORT_FUNCTION(scsh_ldap_simple_bind_s);