Modifies an existing schema element definition.
#include <ldap.h>
int ldap_schema_modify (
LDAPSchema *schema,
char *nameOrOid,
int type,
LDAPSchemaMod *fieldsToChange[]);
(IN) A handle to the schema of a directory.
(IN) A name or OID that identifies the schema definition to modify.
(IN) Type of element to modify. Use the definitions listed in Section 6.11, Schema Element Types.
(IN) An null-terminated array of pointers of LDAPSchemaMod structures. Each structure represents a field in an attribute definition.
See the LDAP Return Codes
for return values.
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.