Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_init_getfilter_buf()

The 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.

Syntax

#include <ldap.h>
LDAPFiltDesc * ldap_init_getfilter_buf(char *buf, long buflen );

Parameters

This function has the following parameters:

buf

Buffer containing LDAP filter configuration information.

buflen

Size of the buffer

Returns

One of the following values:

Example

The following section of code copies the following filter configuration to a buffer in memory.

"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 ) );
...

See Also

ldap_init_getfilter(), ldap_getfilter_free().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23