char*atRetAttr (Af_key *aso, char *attributeName);
voidatFreeAttr (char *attributeValue);
intatSetAttr (Af_key *aso, char *attribute, int mode);
intatSetAttrFile (Af_key *aso, char *filename);
char*atAttrName (char *attribute);
char*atAttrValue (char *attribute);
intatMatchAttr (Af_key *aso, char *attribute);
atRetAttr returns a string representation of the value(s) of the aso attribute named attributeName. If the attribute value is preceded by a value special character (see list below), it will be evaluated accordingly. When the evaluation fails, the original attribute value, including value special character, is returned. When the attribute value is empty, an empty string is returned. When the attribute does not exist or on any other error condition, a null pointer is returned.
Attribute citations (like 7.0) in attribute values will always be expanded by atRetAttr. There is no way to disable attribute expansion. If you need the raw, unexpanded attribute value, use af_retattr (manual page af_attrs(3)).
The attribute value returned by atRetAttr either resides in static memory (in case of AtFS standard attributes) or in allocated memory. Use atFreeAttr on each attribute value returned by atRetAttr when this not needed any longer. This will recycle allocated memory if possible.
atSetAttr sets the attribute attribute for aso. It calls af_setattr (manual page af_attrs(3)) and hence understands the modes AF_ADD, AF_REMOVE, and AF_REPLACE. Alternatively, the mode argument is ignored, when the equal sign between attribute name and value is preceded by either a plus (+) or a minus (-) sign for adding and deleting attribute values. The value special character at (@) will also be evaluated. atSetAttr opens the file and reads its contents. If either the opening or reading fails, the attribute setting is aborted and returns FALSE. On successful execution, atSetAttr returns TRUE, otherwise FALSE.
atSetAttrFile evaluates a file containing attributes. If opens the named file (filename) and interprets each line in the file as attribute argument to atSetAttr.
atAttrName fills a static memory buffer with the name of the given attribute and returns a pointer to this buffer. Subsequent calls of atAttrName overwrite previous results.
atAttrValue returns a pointer to the value part of attribute.
atMatchAttr checks if aso has the given attribute. Result values are TRUE or FALSE. If just an attribute name is given, atMatchAttr returns a positive result if the attribute exists in the asos attribute list or, in the case that it is a standard attribute, if it's value is non null. A full attribute (name and value) must match an attribute in the asos attribute list. The value of the given attribute argument may be a (sh(1)) pattern.
The following is the complete list of value special characters recognized by AtFStk.
Some other names are mapped to the appropriate AtFS standard name:
AtFStk nameAtFS name (constant definition)AtFStk nameAtFS name (constant definition) atime AF_ATTATIMErevisionAF_ATTREV author AF_ATTAUTHORselfAF_ATTBOUND ctime AF_ATTCTIMEselfpathAF_ATTBOUNDPATH dsize AF_ATTDSIZEsizeAF_ATTSIZE generationAF_ATTGENstateAF_ATTSTATE host AF_ATTHOSTstimeAF_ATTSTIME lock AF_ATTLOCKERsyspathAF_ATTSPATH ltime AF_ATTLTIMEtypeAF_ATTTYPE mtime AF_ATTMTIMEunixnameAF_ATTUNIXNAME name AF_ATTNAMEversionAF_ATTVERSION owner AF_ATTOWNER
atSetAttr may also be used to set standard attributes where possible. Attributes that may be altered are
AttributeMapped to AtFS function authoraf_chauthor (af_protect(3)) generation, revision, versionaf_svnum (af_version(3)) mode af_chmod (af_protect(3)) owneraf_chowner (af_protect(3)) stateaf_sstate (af_version(3)) note af_snote (af_note(3))