From: Kurt Zeilenga Date: Mon, 9 Nov 1998 23:21:38 +0000 (+0000) Subject: Add support for runtime determination of API extensions. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~1149 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e6ac1f46c39867ed384b23ad63802752885b33f2;p=openldap Add support for runtime determination of API extensions. --- diff --git a/libraries/libldap/options.c b/libraries/libldap/options.c index b52e95cc78..18b8fa6a2c 100644 --- a/libraries/libldap/options.c +++ b/libraries/libldap/options.c @@ -8,6 +8,16 @@ #include "ldap-int.h" +static const char* features[] = { +#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS + "X_OPENLDAP_V2_DNS", +#endif +#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS + "X_OPENLDAP_V2_REFERRALS", +#endif + NULL +}; + int ldap_get_option( LDAP *ld, @@ -49,7 +59,19 @@ ldap_get_option( info->ldapai_api_version = LDAP_API_VERSION; info->ldapai_api_version = LDAP_API_VERSION; info->ldapai_protocol_version = LDAP_VERSION_MAX; - info->ldapai_extensions = NULL; + if(features[0] == NULL) { + info->ldapai_extensions = NULL; + } else { + int i; + info->ldapai_extensions = malloc(sizeof(features)); + + for(i=0; features[i] != NULL; i++) { + info->ldapai_extensions[i] = strdup(features[i]); + } + + info->ldapai_extensions[i] = NULL; + } + info->ldapai_vendor_name = strdup(LDAP_VENDOR_NAME); info->ldapai_vendor_version = LDAP_VENDOR_VERSION;