ldap_init_getfilter_buf() function reads LDAP filter configuration information from a buffer and returns a pointer to an LDAPFiltDesc structure. The configuration information in the buffer must use the correct syntax, as specified in "Understanding the Configuration File Syntax" on page 158.
For more information, see "Loading a Filter Configuration File" on page 161.
#include <ldap.h>
LDAPFiltDesc * ldap_init_getfilter_buf(char *buf, long buflen );
buf | |
buflen |
LDAPFiltDesc structure. "ldap-example"
"@" " " "(mail=%v)" "email address"
"(mail=%v*)" "start of email address"The example uses this buffer to fill an
LDAPFiltDesc structure.
#include <string.h>
#include <ldap.h>
...
LDAPFiltDesc *lfdp;
char filtbuf[ 1024 ];
...
/* Create the filter config buffer */
strcpy( filtbuf, "\"ldap-example\"\n" );
strcat( filtbuf, " \"@\"\t\" \"\t\"(mail=%v)\"\t\"email address\"\n" );
strcat( filtbuf, " \t\t\"(mail=%v*)\"\t\"start of email address\"\n" );
lfdp = ldap_init_getfilter( filtbuf, strlen( filtbuf ) );
...
ldap_init_getfilter(), ldap_getfilter_free().
Last Updated: 10/01/98 17:06:23