Table of Contents | Previous | Next | Index

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

ldap_set_filter_additions()

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

Syntax

#include <ldap.h>
int ldap_set_filter_additions( LDAPFiltDesc *lfdp, char *prefix,
   char *suffix );

Parameters

This function has the following parameters:

lfdp

Pointer to an LDAPFiltDesc structure.

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.

Returns

One of the following values:

Example

The following section of code loads the filter configuration file named 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 );
}
...

See Also

ldap_getfirstfilter(), ldap_getnextfilter().


Table of Contents | Previous | Next | Index

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