The getprofattr() and getprofnam()
functions each return a prof_attr entry. Entries can
come from any of the sources specified in the nsswitch.conf(4) file.
The getprofattr() function enumerates prof_attr entries. The getprofnam() function
searches for a prof_attr entry with a given name. Successive calls to these functions return either successive prof_attr entries or NULL.
The internal representation of a prof_attr entry
is a profattr_t structure defined in <prof_attr.h> with the following members:
|
char *name; /* Name of the profile */
char *res1; /* Reserved for future use */
char *res2; /* Reserved for future use */
char *desc; /* Description/Purpose of the profile */
kva_t *attr; /* Profile attributes */
|
The free_profattr() function releases memory allocated
by the getprofattr() and getprofnam()
functions.
The setprofattr() function "rewinds"
to the beginning of the enumeration of prof_attr entries.
Calls to getprofnam() can leave the enumeration in an
indeterminate state. Therefore, setprofattr() should
be called before the first call to getprofattr().
The endprofattr() function may be called to indicate
that prof_attr processing is complete; the system may
then close any open prof_attr file, deallocate storage,
and so forth.
The getproflist() function searches for the list
of sub-profiles found in the given profname and allocates
memory to store this list in proflist. The given profname will be included in the list of sub-profiles. The profcnt argument indicates the number of items currently valid
in proflist. Memory allocated by getproflist() should be freed using the free_proflist()
function.
The free_proflist() function frees memory allocated
by the getproflist() function. The profcnt argument specifies the number of items to free from the proflist argument.
|