Working with Search Filters68 Netscape Directory Server Plug-In Programmer’s Guide • January 2002Getting the Search CriteriaTo get the search criteria specified by a search filter, call one of the followingfunctions:• If the filter type is LDAP_FILTER_EQUALITY, LDAP_FILTER_GE,LDAP_FILTER_LE, or LDAP_FILTER_APPROX, you can get the attribute andvalue used in the filter by calling slapi_filter_get_ava().• If the filter type is LDAP_FILTER_PRESENT, you can get the attribute type thatthe filter is searching for by calling the slapi_filter_get_type() function.• If the filter type is LDAP_FILTER_SUBSTRINGS, you can get the attribute typethat the filter searches for by calling slapi_filter_get_subfilt().• To get the components of a complex filter of the type LDAP_FILTER_AND,LDAP_FILTER_OR, or LDAP_FILTER_NOT, call the slapi_filter_list_first()and slapi_filter_list_next() functions.Both of these functions will return either a filter component of the complexfilter or a NULL value, according to the following:m If slapi_list_first() returns a NULL, the complex filter is not of thetype LDAP_FILTER_AND, LDAP_FILTER_OR, or LDAP_FILTER_NOT.m If slapi_list_next() returns a NULL, the component returned by thecall is the last component in the complex filter.LDAP_FILTER_GE The search should find entries that contain a valuegreater than or equal to the specified attribute value.LDAP_FILTER_LE The search should find entries that contain a value lessthan or equal to the specified attribute value.LDAP_FILTER_PRESENT The search should find entries that contain thespecified attribute.LDAP_FILTER_APPROX The search should find entries that contain a valueapproximately matching the specified attribute value.NOTE You do not need to free the values returned by theslapi_filter_get_ava(), slapi_filter_get_type(), andslapi_filter_get_subfilt() functions.Table 5-4 Types of Filters (Continued)Filter Type Description