Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_filter_get_ava()

(Applies only to filters of the types LDAP_FILTER_EQUALITY, LDAP_FILTER_GE, LDAP_FILTER_LE, LDAP_FILTER_APPROX ) Gets the attribute type and the value from the filter.

Syntax

#include "slapi-plugin.h"
int slapi_filter_get_ava( Slapi_Filter *f, char **type,
    struct berval **bval );

Parameters

This function takes the following parameters:

f

Filter from which you wish to get the attribute and value.

type

Pointer to the attribute type of the filter.

bval

Pointer to the address of the berval structure containing the value of the filter.

Returns

This function returns 0 if successful, or -1 if the filter is not one of the types listed above.

Description

Filters of the type LDAP_FILTER_EQUALITY, LDAP_FILTER_GE , LDAP_FILTER_LE, and LDAP_FILTER_APPROX generally compare a value against an attribute. For example:

(cn=Barbara Jensen)

This filter finds entries in which the value of the cn attribute is equal to Barbara Jensen.

The attribute type is returned in the parameter type, and the value is returned in the parameter bval.

Memory Concerns

The strings within the parameters type and bval are direct pointers to memory inside the Slapi_Filter , and therefore should not be freed after usage. They will be freed when a server entity calls slapi_filter_free() after usage of the Slapi_Filter structure.

See Also

slapi_filter_get_choice()

slapi_filter_get_type()

slapi_filter_get_attribute_type()