]> granicus.if.org Git - php/commitdiff
Better not include ldap_parse_result() and ldap_start_tls() at all in
authorStig Venaas <venaas@php.net>
Sat, 22 Jun 2002 15:41:39 +0000 (15:41 +0000)
committerStig Venaas <venaas@php.net>
Sat, 22 Jun 2002 15:41:39 +0000 (15:41 +0000)
the symbol table when they are not usable. Makes it possible to check
on their usability.

ext/ldap/ldap.c

index 5d8b03559fcc73c6ee3d8973723024b73521f5c6..6706c27760aab1acb5e60b7c015d6a4477e57cdb 100644 (file)
@@ -119,13 +119,14 @@ function_entry ldap_functions[] = {
        PHP_FE(ldap_parse_result,                       arg3to6of6_force_ref)
        PHP_FE(ldap_first_reference,                                            NULL)
        PHP_FE(ldap_next_reference,                                                     NULL)
+#ifdef HAVE_LDAP_PARSE_REFERENCE
        PHP_FE(ldap_parse_reference,    third_argument_force_ref)
-       PHP_FE(ldap_rename,                                                                     NULL)
 #endif
-
-#if LDAP_API_VERSION > 2000
+       PHP_FE(ldap_rename,                                                                     NULL)
+#ifdef HAVE_LDAP_START_TLS_S
        PHP_FE(ldap_start_tls,                                                          NULL)
 #endif
+#endif
 
 #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
        PHP_FE(ldap_set_rebind_proc,                                            NULL)
@@ -1942,11 +1943,11 @@ PHP_FUNCTION(ldap_next_reference)
 }
 /* }}} */
 
+#ifdef HAVE_LDAP_PARSE_REFERENCE
 /* {{{ proto bool ldap_parse_reference(resource link, resource reference_entry, array referrals)
    Extract information from reference entry */
 PHP_FUNCTION(ldap_parse_reference)
 {
-#ifdef HAVE_LDAP_PARSE_REFERENCE
        pval **link, **result_entry, **referrals;
        ldap_linkdata *ld;
        ldap_resultentry *resultentry;
@@ -1978,12 +1979,9 @@ PHP_FUNCTION(ldap_parse_reference)
                ldap_value_free(lreferrals);
        }
        RETURN_TRUE;
-#else
-       php_error(E_ERROR, "ldap_parse_reference not available in this LDAP lib");
-       RETURN_FALSE;
-#endif
 }
 /* }}} */
+#endif
 
 /* {{{ proto bool ldap_rename(resource link, string dn, string newrdn, string newparent, boolean deleteoldrdn);
    Modify the name of an entry */
@@ -2021,14 +2019,12 @@ PHP_FUNCTION(ldap_rename)
        RETURN_FALSE;
 }
 /* }}} */
-#endif
 
-#if LDAP_API_VERSION > 2000
+#ifdef HAVE_LDAP_START_TLS_S
 /* {{{ proto bool ldap_start_tls(resource link)
    Start TLS */
 PHP_FUNCTION(ldap_start_tls)
 {
-#ifdef HAVE_LDAP_START_TLS_S
        pval **link;
        ldap_linkdata *ld;
 
@@ -2045,13 +2041,10 @@ PHP_FUNCTION(ldap_start_tls)
        } else {
                RETURN_TRUE;
        }
-#else
-       php_error(E_ERROR, "ldap_start_tls not available in this LDAP library");
-       RETURN_FALSE;
-#endif
 }
 /* }}} */
 #endif
+#endif /* ( LDAP_API_VERSION > 2000 ) || HAVE_NSLDAP */
 
 
 #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)