HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
20.22 slapi_get_first_back end()
Description This function returns a pointer to the back end structure of the first back end. If
you wish to iterate through all the back ends, use this function in conjunction with
“slapi_get_next_back end()”. For example:
Slapi_Back end *be = NULL;
char *cookie = NULL;
be = slapi_get_first_back end (&cookie);
while (be ) {
...
be = slapi_get_next_back end (cookie);
} slapi_ch_free ((void**)&cookie);
Syntax
#include "slapi-plugin.h"
Slapi_Back end* slapi_get_first_back end(char **cookie);
Parameters This function takes the following parameter:
Output parameter containing the index of the returned back end. This is useful for calls
to slapi_get_next_back end(). Contains 0 in output if no back end is returned.
cookie
Returns This function returns one of the following values:
A pointer to the back end structure of the first back end and its index in the cookie
parameter.
NULL if there is no back end.
Memory concerns Free the cookie parameter after the iteration using slapi_ch_free().
See also “slapi_get_next_back end()”
20.23 slapi_get_first_suffix()
Description This function returns the first root suffix of the DIT. If you wish to iterate through
all the suffixes, use this function in conjunction with “slapi_get_next_suffix()”. For example:
void *node = NULL;
Slapi_DN * suffix = slapi_get_first_suffix (&node, 1);
while (suffix) {
...
suffix = slapi_get_next_suffix (&node, 1);
}
Syntax
#include "slapi-plugin.h"
Slapi_DN * slapi_get_first_suffix(void ** node, int show_private);
Parameters This function takes the following parameter:
Contains the returned valued, which is the DN of the first root suffix of the DIT.
node
0 checks only for non-private suffixes.
1 checks for both private and non-private suffixes.
show_private
Returns This function returns the DN of the first root suffix.
Memory concerns You should not free the returned pointer.
See also “slapi_get_next_suffix()”
190 Functions for managing back end operations