Sun Microsystems, Inc.
spacer | | |  
black dot
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
XFN Interface Library FunctionsFN_attrset_t(3XFN)


 FN_attrset_t, fn_attrset_create, fn_attrset_destroy, fn_attrset_copy, fn_attrset_assign, fn_attrset_get, fn_attrset_count, fn_attrset_first, fn_attrset_next, fn_attrset_add, fn_attrset_remove - a set of XFN attributes


cc [ flag ... ] file ... -lxfn [ library ... ]
#include <xfn/xfn.h>
FN_attrset_t *fn_attrset_create(void);
 void fn_attrset_destroy(FN_attrset_t *aset);
 FN_attrset_t *fn_attrset_copy(constFN_attrset_t *aset);
 FN_attrset_t *fn_attrset_assign(FN_attrset_t *dst, const FN_attrset_t *src);
 const FN_attribute_t *fn_attrset_get(constconst FN_attrset_t *aset, const FN_identifier_t *attr_id);
 unsigned int fn_attrset_count(constFN_attrset_t *aset);
 const FN_attribute_t *fn_attrset_first(constFN_attrset_t *aset, void **iter_pos);
 const FN_attribute_t *fn_attrset_next(constFN_attrset_t *aset, void **iter_pos);
 int fn_attrset_add(FN_attrset_t *aset, const FN_attribute_t *attr, unsigned int exclusive);
 int fn_attrset_remove(FN_attrset_t *aset, const FN_identifier_t *attr_id);



An attribute set is a set of attribute objects with distinct identifiers. The fn_attr_multi_get(3XFN) operation takes an attribute set as parameter and returns an attribute set. The fn_attr_get_ids(3XFN) operation returns an attribute set containing the identifiers of the attributes.

Attribute sets are represented by the type FN_attrset_t. The following operations are defined for manipulating attribute sets.

fn_attrset_create() creates an empty attribute set. fn_attrset_destroy() releases the storage associated with the attribute set aset. fn_attrset_copy() returns a copy of the attribute set aset. fn_attrset_assign() makes a copy of the attribute set src and assigns it to dst, releasing any old contents of dst. A pointer to the same object as dst is returned.

fn_attrset_get() returns the attribute with the given identifier attr_id from aset. fn_attrset_count() returns the number attributes found in the attribute set aset.

fn_attrset_first() and fn_attrset_next() are functions that can be used to return an enumeration of all the attributes in an attribute set. The attributes are not ordered in any way. There is no guaranteed relation between the order in which items are added to an attribute set and the order of the enumeration. The specification does guarantee that any two enumerations will return the members in the same order, provided that no fn_attrset_add() or fn_attrset_remove() operation was performed on the object in between or during the two enumerations. fn_attrset_first() returns the first attribute from the set and sets iter_pos after the first attribute. fn_attrset_next () returns the attribute following iter_pos and advances iter_pos.

fn_attrset_add() adds the attribute attr to the attribute set aset, replacing the attribute's values if the identifier of attr is not distinct in aset and exclusive is 0. If exclusive is non-zero and the identifier of attr is not distinct in aset, the operation fails.

fn_attrset_remove() removes the attribute with the identifier attr_id from aset. The operation succeeds even if no such attribute occurs in aset.



fn_attrset_first() returns 0 if the attribute set is empty. fn_attrset_next() returns 0 if there are no more attributes in the set.

fn_attrset_add() and fn_attrset_remove() return 1 if the operation succeeds, and 0 if the operation fails.



Manipulation of attributes using the operations described in this manual page does not affect their representation in the underlying naming system. Changes to attributes in the underlying naming system can only be effected through the use of the interfaces described in xfn_attributes(3XFN).



See attributes(5) for descriptions of the following attributes:




FN_attribute_t(3XFN), FN_attrvalue_t(3XFN), FN_identifier_t(3XFN), fn_attr_get_ids(3XFN), fn_attr_multi_get(3XFN), xfn(3XFN), xfn_attributes(3XFN), attributes(5)



The implementation of XFN in this Solaris release is based on the X/Open preliminary specification. It is likely that there will be minor changes to these interfaces to reflect changes in the final version of this specification. The next minor release of Solaris will offer binary compatibility for applications developed using the current interfaces. As the interfaces evolve toward standardization, it is possible that future releases of Solaris will require minor source code changes to applications that have been developed against the preliminary specification.

SunOS 5.9Go To TopLast Changed 13 Dec 1996

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.