#include <ldap.h>
int ldap_memcache_init( unsigned long ttl, unsigned long size,
char **baseDNs, struct ldap_thread_fns *thread_fns,
LDAPMemCache **cachep );
LDAP_SUCCESS if the cache was successfully created. LDAP_PARAM_ERROR if an invalid parameter was passed to the function LDAP_NO_MEMORY if memory cannot be allocated. LDAP_SIZELIMIT_EXCEEDED if the initial size of the cache (specified by the size argument) is too small. ldap_memcache_init() function creates an in-memory, client-side cache that you can use to cache search requests.
The function passes back a pointer to an LDAPMemCache structure, which represents the cache. You should call the ldap_memcache_set() function to associate this cache with an LDAP connection handle (an LDAP structure).
On Windows NT, if the ldap_memcache_init() function returns an LDAP_PARAM_ERROR result code, verify that your client is using the version of the nsldap32v30.dll file provided with the Netscape Directory SDK 3.0 for C. (Some of the Netscape servers, such as the Netscape Directory Server 3.0, install an older verison of the nsldap32v30.dll file in the Windows system32 directory.) For example, you may want to copy the nsldap32v30.dll file provided with the Netscape Directory SDK 3.0 for C to your client's directory.
The cache uses search criteria as the key to cached items. When you send a search request, the cache checks the search criteria to determine if that request has been cached previously. If the request was cached, the search results are read from the cache.
To flush the cache, call the ldap_memcache_flush() function.
When you are done with the cache, you can free it from memory by calling the ldap_memcache_destroy() function.
LDAPMemCache, ldap_memcache_set(), ldap_memcache_get(), ldap_memcache_update(), ldap_memcache_flush(), ldap_memcache_destroy().
Last Updated: 10/01/98 17:06:23