The
extattr_namespace_to_string()
function converts a VFS extended attribute identifier to a human-readable
string;
the
extattr_string_to_namespace()
function undoes the aforementioned operation,
and converts a human-readable string representing a namespace to a
namespace identifier.
Although a file system may implement arbitrary namespaces,
these functions only support the
EXTATTR_NAMESPACE_USER
("user")
and
EXTATTR_NAMESPACE_SYSTEM
("system")
namespaces,
which are defined in
extattr(9).
These functions are meant to be used in error reporting and other
interactive tasks.
For example,
instead of printing the integer identifying an extended attribute in
an error message,
a program might use
extattr_namespace_to_string()
to obtain a human-readable representation.
Likewise,
instead of requiring a user to enter the integer representing a namespace,
an interactive program might ask for a name and use
extattr_string_to_namespace()
to get the desired identifier.