ldap_schema_modify

Modifies an existing schema element definition.

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_modify (
     LDAPSchema     *schema,
     char           *nameOrOid,
     int            type,
     LDAPSchemaMod  *fieldsToChange[]);
  

Parameters

schema

(IN) A handle to the schema of a directory.

nameOrOid

(IN) A name or OID that identifies the schema definition to modify.

type

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

fieldsToChange

(IN) An null-terminated array of pointers of LDAPSchemaMod structures. Each structure represents a field in an attribute definition.

Return Values

See the LDAP Return Codes for return values.

Remarks

ldap_schema_modify modifies an existing schema element definition. Using an existing definition in schema, this constructs a new definition according the list of fields passed in. Modifications are only made to the LDAPSchema structure. To commit this modification to the directory, call ldap_schema_save.

A field with an operation code of LDAP_MOD_ADD will add values to a field, creating new fields if one does not already exist. A field with an operation code of LDAP_MOD_REPLACE will replace the existing field values, or creating new values if the field does not exist. A field with an operation of LDAP_MOD_DELETE will remove the field values listed, if they exist.