Description

The template property functions locate and give access to metadata about properties.
They require that the template for the property group containing the
property has already been located by one of the scf_tmpl_pg_create(3SCF) suite of
functions.

Before calling scf_tmpl_get_by_prop() or scf_tmpl_iter_props(), the scf_prop_tmpl_t must be allocated by scf_tmpl_prop_create.
The scf_prop_tmpl_t can be reset to contain no template information with scf_tmpl_prop_reset(), so
that it can be used to start an iteration from scratch. All
associated memory can be freed with scf_tmpl_prop_destroy().

The scf_tmpl_get_by_prop() function locates template data about the property name specified.

The scf_tmpl_iter_props() function iterates across all property templates defined in the specified
property group template.

The iterator state for scf_tmpl_iter_props() is stored on the property template data
structure. The data structure should be allocated with scf_tmpl_prop_create(), and to continue
the iteration the previously returned structure should be passed in as an argument.

Return Values

The scf_tmpl_get_by_prop() function returns -1 on failure and 0 on success.

The scf_tmpl_iter_props() function returns 0 for successful iteration to the next item,
1 for iteration successfully reaching its end, and —1 on error.

Errors

The scf_tmpl_get_by_prop() and scf_tmpl_iter_props() functions will fail if:

SCF_ERROR_BACKEND_ACCESS

The storage mechanism that the repository server (svc.configd(1M)) chose for the operation denied access.