Sun Java System Directory Server Enterprise Edition 6.3 Developer's Guide

slapi_get_next_backend()

Returns a pointer to the next backend.

Syntax

#include "slapi-plugin.h"
Slapi_Backend* slapi_get_next_backend(char *cookie);

Parameters

This function takes the following parameters:

cookie

Upon input, contains the index from which the search for the next backend is done. Upon output, contains the index of the returned backend.

Returns

This function returns a pointer to the next backend, if it exists, and updates the cookie parameter. Otherwise, it returns NULL and cookie is not changed.

Description

This function returns a pointer to the next backend. If you wish to iterate through all of the backends, use this function in conjunction with slapi_get_first_backend(). For example:

Slapi_Backend *be = NULL;
char *cookie = NULL;
be = slapi_get_first_backend (&cookie);
while (be )
    {
    ...
    be = slapi_get_next_backend (cookie);
    }
slapi_ch_free ((void**)&cookie);

Memory Concerns

Free the cookie parameter after the iteration using slapi_ch_free().

See Also

slapi_get_first_backend()

slapi_ch_free()