[Previous] [Next] [TOC] [Index]

ldap_version()

Gets version information about the Directory SDK libraries. The version information is returned in an LDAPVersion structure.

Syntax
#include <ldap.h>
int ldap_version( LDAPVersion *ver );
Parameters
This function has the following parameters:
ver
LDAPVersion structure returning version information. If you only want the SDK version, you can pass NULL for this parameter.

Returns
Returns the version number of the Directory SDK, multiplied by 100. (For example, for version 1.0 of the Directory SDK, the function returns 100.)

Example
The following example prints version information about the Directory SDK.

#include <ldap.h>
#include <stdio.h>
...
LDAPVersion ver;
double SDKVersion;
...
/* Print version information */
SDKVersion = ldap_version( &ver );
printf( "SDK Version: %1.2f\n", SDKVersion/100.0 );
printf( "Highest LDAP Protocol Supported: %1.2f\n", 
         ver.protocol_version/100.0 );
printf( "SSL Level Supported: %1.2f\n", ver.SSL_version/100.0 );
if ( ver.security_level != LDAP_SECURITY_NONE ) {
   printf( "Level of encryption: %d bits\n", ver.security_level );
} else {
   printf( "SSL not enabled.\n" );
}
...


[Previous] [Next] [TOC] [Index]

Last modified: March 31, 1997
Copyright © 1997 Netscape Communications Corporation