Federated Naming Service Programming Guide

Modify Attribute

This operation modifies according to mod_op the attribute attr associated with the object named name, relative to ctx. If name is empty, the attribute associated with ctx is modified.


int fn_attr_modify(
    FN_ctx_t *ctx,
    const FN_composite_name_t *name,
    unsigned int mod_op,
    const   FN_attribute_t *attr,
    FN_status_t *status);
Table 2-1 XFN Attribute-Modification Operations

Operation Code 

Meaning 

FN_ATTR_OP_ADD()

Add an attribute with given attribute identifier and set of values. If an attribute with this identifier already exists, replace the set of values with those in the given set. The set of values can be empty if the target naming system permits. 

FN_ATTR_OP_ADD_EXCLUSIVE()

Add an attribute with the given attribute identifier and set of values. The operation fails if an attribute with this identifier already exists. The set of values can be empty if the target naming system permits. 

FN_ATTR_OP_ADD_VALUES ()

Add the given values to those of the given attribute (resulting in the attribute having the union of its prior value set with the given set). Create the attribute if it does not already exist. The set of values can be empty if the target naming system permits. 

FN_ATTR_OP_REMOVE ()

Remove the attribute with the given attribute identifier and all its values. The operation succeeds even if the attribute does not exist. The values of the attribute supplied with this operation are ignored. 

FN_ATTR_OP_REMOVE_VALUES()

Remove the given values from those of the given attribute (resulting in the attribute having the set difference of its prior value set and the given set). This succeeds even if some of the given values are not in the set of values that the attribute has. In naming systems that require an attribute to have at least one value, removing the last value removes the attribute as well.