Allows you to iterate through schema elements of a specific type.
#include <ldap.h>
int ldap_schema_get_by_index (
LDAPSchema *schema,
int index,
int elementType,
LDAPSchemaElement **element);
(IN) A handle to the schema of an LDAP directory.
(IN) index of the desired schema element. (Uses array numbering; starts at zero.
ldap_schema_get_count is used to determine valid indices for this parameter.
(IN) Type of element requested. Use the definitions listed in Section 6.11, Schema Element Types.
(OUT) Address to a handle of the schema element requested. The user must not modify this memory.
See the LDAP Return Codes
for return values.
The index is zero based and goes through ldap_schema_get_count - 1. The returned handle to an LDAPSchemaElement structure, ’element’, is a pointer to memory within the LDAPSchema structure, ’schema’. Therefore if ’schema’ changes or is freed, ’element’ may also change, or become invalid. Likewise, if the user frees or tampers with ’element’, ’schema’ may become corrupted.