Chapter 26. Functions for Dealing with Filters
Table 26.1. Filter Routines
| Function | Description |
|---|---|
| slapi_filter_apply() | Applies a function to each simple filter component within a complex filter. |
| slapi_filter_compare() | Determines if two filters are identical. |
| slapi_filter_dup() | Duplicates the specified filter. |
| slapi_filter_free() | Frees the specified filter. |
| slapi_filter_get_attribute_type() | Gets the attribute type for all simple filter choices. |
| slapi_filter_get_ava() | Gets the attribute type and the value from the filter. |
| slapi_filter_get_choice() | Gets the type of the specified filter. |
| slapi_filter_get_subfilt() | Gets the substring values from the filter. |
| slapi_filter_get_type() | Gets the attribute type specified in the filter. |
| slapi_filter_join() | Joins two specified filters. |
| slapi_filter_join_ex() | Recursively joins two specified filters. |
| slapi_filter_list_first() | Gets the first filter that makes up the specified filter. |
| slapi_filter_list_next() | Gets the next filter. |
| slapi_filter_test() | Determines if the specified entry matches a particular filter. |
| slapi_filter_test_ext() | Determines if an entry matches a given filter. |
| slapi_filter_test_simple() | Determines if an entry matches a filter. |
| slapi_find_matching_paren() | Finds the matching right parentheses in a string, corresponding to the left parenthesis to which the string currently points. |
| slapi_str2filter() | Converts a string description of a search filter into a filter of the Slapi_Filter type. |
| slapi_vattr_filter_test() | Tests a filter against a single entry. |
26.1. slapi_filter_apply()
#include "slapi-plugin.h" int slapi_filter_apply( struct slapi_filter *f, FILTER_APPLY_FN fn, void *arg, int *error_code );
This function takes the following parameters:
|
f
| Filter on which the function is to be applied. |
|
fn
| Function to apply. |
|
arg
| Argument to the function (fn). |
|
error_code
| Pointer to error code of fn, which can be accessed by calling function. Possible values slapi_filter_apply() may set in error_code include SLAPI_FILTER_UNKNOWN_FILTER_TYPE. A FILTER_APPLY_FN should return _STOP or _CONTINUE only. |
This function returns an integer. Possible return values for slapi_filter_apply() include:
SLAPI_FILTER_SCAN_NOMOREindicates success in traversing the entire filter.SLAPI_FILTER_SCAN_STOPindicates premature abort.SLAPI_FILTER_SCAN_CONTINUEindicates continue scanning.SLAPI_FILTER_SCAN_ERRORindicates an occurred during the traverse and the scan is aborted. In this case, error_code can be checked for more details; currently, the only error isSLAPI_FILTER_UNKNOWN_FILTER_TYPE.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.