ldap_schema_get_by_index

Allows you to iterate through schema elements of a specific type.

Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  int ldap_schema_get_by_index (
     LDAPSchema          *schema,
     int                 index,
     int                 elementType,
     LDAPSchemaElement  **element);
  

Parameters

schema

(IN) A handle to the schema of an LDAP directory.

index

(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.

elementType

(IN) Type of element requested. Use the definitions listed in Section 6.11, Schema Element Types.

element

(OUT) Address to a handle of the schema element requested. The user must not modify this memory.

Return Values

See the LDAP Return Codes for return values.

Remarks

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.

Remarks

See Also

ldap_schema_get_count