scf_tmpl_prop_create, scf_tmpl_prop_reset, scf_tmpl_prop_destroy, scf_tmpl_get_by_prop, scf_tmpl_iter_props - template property functions
cc [ flag... ] file... -lscf [ library... ] #include <libscf.h> scf_prop_tmpl_t *scf_tmpl_prop_create(scf_handle_t *handle);
void scf_tmpl_prop_reset(scf_prop_tmpl_t *prop_tmpl);
void scf_tmpl_prop_destroy(scf_prop_tmpl_t *prop_tmpl);
int scf_tmpl_get_by_prop(scf_pg_tmpl_t *pg_tmpl, const char *prop, scf_prop_tmpl_t *prop_tmpl, int flags)
int scf_tmpl_iter_props(scf_pg_tmpl_t *pg_tmpl, const char *fmri, scf_prop_tmpl_t *prop_tmpl, int flags);
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.
Once retrieved, the scf_prop_tmpl_t can be explored using the scf_tmpl_prop_name(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.
The scf_tmpl_get_by_prop() function returns -1 on failure and 0 on success.
The scf_tmpl_iter_props() function returns 1 on successful completion. If the iteration is complete, it returns 0. It returns -1 on error.
The scf_tmpl_get_by_prop() and scf_tmpl_iter_props() functions will fail if:
SCF_ERROR_BACKEND_ACCESS
SCF_ERROR_CONNECTION_BROKEN
SCF_ERROR_DELETED
SCF_ERROR_HANDLE_DESTROYED
SCF_ERROR_INTERNAL
SCF_ERROR_INVALID_ARGUMENT
SCF_ERROR_NO_MEMORY
SCF_ERROR_NO_RESOURCES
SCF_ERROR_NOT_BOUND
The scf_tmpl_get_by_prop() function will fail if:
SCF_ERROR_NOT_FOUND
SCF_ERROR_TYPE_MISMATCH
SCF_ERROR_PERMISSION_DENIED
SCF_ERROR_TEMPLATE_INVALID
The scf_tmpl_prop_create() function will fail if:
SCF_ERROR_INVALID_ARGUMENT
SCF_ERROR_NO_MEMORY
See attributes(5) for descriptions of the following attributes:
|
svc.configd(1M), scf_tmpl_pg_create(3SCF), scf_tmpl_prop_name(3SCF), attributes(5), smf_template(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |