af_attrs(3) | Attribute Filesystem (AtFS) | af_attrs(3) |
af_retattr, af_retnumattr, af_retuserattr, af_rettimeattr, af_setattr, af_allattrs, af_isstdval, af_freeattr, af_freeattrbuf - AtFS attribute handling
#include <atfs.h>
char *af_retattr (Af_key *aso, char *attrName)
int af_retnumattr (Af_key *aso, char *attrName)
Af_user af_retuserattr (Af_key *aso, char *attrName)
time_t af_rettimeattr (Af_key *aso, char *attrName)
int af_setattr (Af_key *aso, int mode, char *attrName)
int af_allattrs (Af_key *aso, Af_attrs *attrBuf)
void af_freeattr (char *attrValue);
void af_freeattrbuf (Af_attrs *attrBuf);
int af_isstdval (char *attrValue);
af_retattr returns the value of any ASO attribute in string representation. The attrName argument denotes either a standard attribute (according to the list below) or a user defined attribute. Standard attributes are converted to a meaningful string representation if necessary. If the attribute name given to af_retattr contains an equal sign (this may be the case with user defined attributes), only the part before the equal sign will be interpreted as name. If the named attribute is a user defined attribute carrying multiple values, these will be returned in one string, with the values separated by newline ('\n') characters. If the named attribute does not exist, af_retattr returns a null pointer. If the value is empty, an empty string is returned. Note: The result string of af_retattr may reside in static memory which is overwritten on subsequent calls of af_retattr.
af_retnumattr, af_retuserattr, and af_rettimeattr return the value of the named attribute as integer, user structure or time value. These functions only apply to standard attributes with a matching type.
Af_setattr sets, modifies, or deletes user defined attributes of the ASO identified by aso. The attr parameter is a string of the form: name=value. The name may consist of any characters (even non-printable) but it may not contain Ctrl-A (\001) characters. The first equal sign that appears in the string is interpreted as the delimiter between name and value. If the string does not contain an equal sign, it is interpreted as just an attribute name without value. The mode parameter is one of the following:
af_allattrs returns the complete attribute buffer (attrBuf) of the ASO identified by aso including standard and user defined attributes. The af_retrieve(3) manual page shows the structure of the attribute buffer.
af_freeattr and af_freeattrbuf release memory eventually allocated during a af_retattr or af_allattrs call. As the result of af_retattr may reside either in static or dynamic (malloc(3)) memory, you should not use free(3) for releasing attribute value memory.
af_isstdval returns TRUE if the given attrValue string is the return value of an af_retattr call where the result was written to static rather than allocated memory. Otherwise it returns FALSE.
The following is an alphabetically ordered list of all known standard attributes. AF_ATT... are string constants that may be used as attrName argument for any of the function calls described on this manual page. In parenthesis behind each symbolic constant, the type of the attribute is shown.
Upon error, -1 or a nil pointer (depending on the return type) is returned and af_errno is set to the corresponding error number.
Although AtFS promises the storage of an arbitrary number of user defined attributes, the current implementation limits their number to 255. af_setattr sets the corresponding error condition if the limit is reached.
Fri Jun 25 14:33:00 1993 | AtFS-1.71 |