ldap_set_filter_additions() function sets a prefix to be prepended and a suffix to be appended to all filters returned by the ldap_getfirstfilter() and ldap_getnextfilter() function calls.
#include <ldap.h>
int ldap_set_filter_additions( LDAPFiltDesc *lfdp, char *prefix,
char *suffix );
lfdp |
Pointer to an |
prefix | Prefix to prepend to all filters. If NULL, no prefix is prepended. |
suffix | Suffix to append to all filters. If NULL, no suffix is appended. |
LDAP_SUCCESS if successful. myfilters.conf into memory and adds the prefix "(&(objectClass=person)" and the suffix ")" to each filter retrieved:
#include <ldap.h>
...
LDAPFiltDesc *lfdp;
char *filter_file = "myfilters.conf";
char *prefix = "(&(objectClass=person)";
char *suffix = ")";
int rc;
...
lfdp = ldap_init_getfilter( filter_file );
rc = ldap_set_filter_additions( ldfp, prefix, suffix );
if ( rc != LDAP_SUCCESS ) {printf( "Error setting filter prefix and suffix\n");
return( rc );
}
...
ldap_getfirstfilter(), ldap_getnextfilter().
Last Updated: 10/01/98 17:06:23