Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 3: Extended Library Functions, Volume 4 Oracle Solaris 11 Express 11/10 |
Extended Library Functions, Volume 4
gl_customize_completion(3TECLA)
scf_count_ranges_destroy(3SCF)
scf_entry_destroy_children(3SCF)
scf_instance_get_pg_composed(3SCF)
scf_instance_get_snapshot(3SCF)
scf_iter_instance_pgs_composed(3SCF)
scf_iter_instance_pgs_typed(3SCF)
scf_iter_instance_pgs_typed_composed(3SCF)
scf_iter_instance_snapshots(3SCF)
scf_iter_property_values(3SCF)
scf_iter_service_instances(3SCF)
scf_iter_service_pgs_typed(3SCF)
scf_iter_snaplevel_pgs_typed(3SCF)
scf_pg_get_parent_instance(3SCF)
scf_pg_get_parent_service(3SCF)
scf_pg_get_parent_snaplevel(3SCF)
scf_pg_get_underlying_pg(3SCF)
scf_service_add_instance(3SCF)
scf_service_get_instance(3SCF)
scf_simple_app_props_free(3SCF)
scf_simple_app_props_get(3SCF)
scf_simple_app_props_next(3SCF)
scf_simple_app_props_search(3SCF)
scf_simple_prop_next_astring(3SCF)
scf_simple_prop_next_boolean(3SCF)
scf_simple_prop_next_count(3SCF)
scf_simple_prop_next_integer(3SCF)
scf_simple_prop_next_opaque(3SCF)
scf_simple_prop_next_reset(3SCF)
scf_simple_prop_next_time(3SCF)
scf_simple_prop_next_ustring(3SCF)
scf_simple_prop_numvalues(3SCF)
scf_simple_walk_instances(3SCF)
scf_snaplevel_get_instance_name(3SCF)
scf_snaplevel_get_next_snaplevel(3SCF)
scf_snaplevel_get_parent(3SCF)
scf_snaplevel_get_scope_name(3SCF)
scf_snaplevel_get_service_name(3SCF)
scf_snapshot_get_base_snaplevel(3SCF)
scf_tmpl_error_prop_tmpl(3SCF)
scf_tmpl_error_source_fmri(3SCF)
scf_tmpl_prop_cardinality(3SCF)
scf_tmpl_prop_common_name(3SCF)
scf_tmpl_prop_description(3SCF)
scf_tmpl_prop_internal_seps(3SCF)
scf_tmpl_prop_visibility(3SCF)
scf_tmpl_value_common_name(3SCF)
scf_tmpl_value_count_range_choices(3SCF)
scf_tmpl_value_count_range_constraints(3SCF)
scf_tmpl_value_description(3SCF)
scf_tmpl_value_int_range_choices(3SCF)
scf_tmpl_value_int_range_constraints(3SCF)
scf_tmpl_value_name_choices(3SCF)
scf_tmpl_value_name_constraints(3SCF)
scf_tmpl_visibility_to_string(3SCF)
scf_transaction_destroy_children(3SCF)
scf_transaction_property_change(3SCF)
scf_transaction_property_change_type(3SCF)
scf_transaction_property_delete(3SCF)
scf_transaction_property_new(3SCF)
scf_transaction_reset_all(3SCF)
scf_value_get_as_string_typed(3SCF)
scf_value_set_from_string(3SCF)
stmfGetHostGroupMembers(3STMF)
stmfGetLogicalUnitProperties(3STMF)
stmfGetProviderDataProt(3STMF)
stmfGetTargetGroupMembers(3STMF)
stmfGetTargetProperties(3STMF)
stmfRemoveFromHostGroup(3STMF)
stmfRemoveFromTargetGroup(3STMF)
stmfSetProviderDataProt(3STMF)
sysevent_bind_handle(3SYSEVENT)
sysevent_get_attr_list(3SYSEVENT)
sysevent_get_class_name(3SYSEVENT)
sysevent_get_pub_name(3SYSEVENT)
sysevent_get_subclass_name(3SYSEVENT)
sysevent_get_vendor_name(3SYSEVENT)
sysevent_post_event(3SYSEVENT)
sysevent_subscribe_event(3SYSEVENT)
sysevent_unbind_handle(3SYSEVENT)
sysevent_unsubscribe_event(3SYSEVENT)
tnfctl_filter_list_delete(3TNF)
tnfctl_probe_disconnect_all(3TNF)
volmgt_feature_enabled(3VOLMGT)
wsreg_add_child_component(3WSREG)
wsreg_add_compatible_version(3WSREG)
wsreg_add_dependent_component(3WSREG)
wsreg_add_display_name(3WSREG)
wsreg_add_required_component(3WSREG)
wsreg_can_access_registry(3WSREG)
wsreg_components_equal(3WSREG)
wsreg_create_component(3WSREG)
wsreg_free_component_array(3WSREG)
wsreg_get_child_components(3WSREG)
wsreg_get_compatible_versions(3WSREG)
wsreg_get_dependent_components(3WSREG)
wsreg_get_display_languages(3WSREG)
wsreg_get_display_name(3WSREG)
wsreg_get_required_components(3WSREG)
wsreg_query_get_instance(3WSREG)
wsreg_query_get_location(3WSREG)
wsreg_query_get_unique_name(3WSREG)
wsreg_query_get_version(3WSREG)
wsreg_query_set_instance(3WSREG)
wsreg_query_set_location(3WSREG)
wsreg_query_set_unique_name(3WSREG)
wsreg_query_set_version(3WSREG)
wsreg_remove_child_component(3WSREG)
wsreg_remove_compatible_version(3WSREG)
wsreg_remove_dependent_component(3WSREG)
wsreg_remove_display_name(3WSREG)
wsreg_remove_required_component(3WSREG)
XTSOLgetClientAttributes(3XTSOL)
XTSOLgetPropAttributes(3XTSOL)
- retrieve the metadata about a specific property
cc [ flag… ] file… -lscf [ library… ] #include <libscf.h> ssize_t scf_tmpl_prop_name(const scf_prop_tmpl_t *prop_tmpl, char **out);
int scf_tmpl_prop_type(const scf_prop_tmpl_t *prop_tmpl, scf_type_t *out);
int scf_tmpl_prop_required(const scf_prop_tmpl_t *prop_tmpl, uint8_t *out)
ssize_t scf_tmpl_prop_common_name(const scf_prop_tmpl_t *prop_tmpl, char *locale, char **out);
ssize_t scf_tmpl_prop_description(const scf_prop_tmpl_t *prop_tmpl, char * locale, char **out);
ssize_t scf_tmpl_prop_units(const scf_prop_tmpl_t *prop_tmpl, const char *locale, char **out);
int scf_tmpl_prop_visibility(const scf_prop_tmpl_t *prop_tmpl, uint8_t *out);
const char *scf_tmpl_visibility_to_string(uint8_t visibility);
int scf_tmpl_prop_cardinality(const scf_prop_tmpl_t *prop_tmpl, uint64_t *min, uint64_t *max);
int scf_tmpl_prop_internal_seps(const scf_prop_tmpl_t *prop_tmpl, scf_values_t *out);
int scf_tmpl_value_name_constraints(const scf_prop_tmpl_t *prop_tmpl, scf_values_t *out);
void scf_count_ranges_destroy(scf_count_ranges_t *ranges);
void scf_int_ranges_destroy(scf_int_ranges_t *ranges);
int scf_tmpl_value_count_range_constraints( const scf_prop_tmpl_t *prop_tmpl, scf_count_ranges_t *ranges);
int scf_tmpl_value_int_range_constraints( const scf_prop_tmpl_t *prop_tmpl, scf_int_ranges_t *ranges);
int scf_tmpl_value_name_choices(const scf_prop_tmpl_t *prop_tmpl, scf_values_t *vals);
void scf_values_destroy(scf_values_t *vals);
int scf_tmpl_value_count_range_choices( const scf_prop_tmpl_t *prop_tmpl, scf_count_ranges_t *ranges);
int scf_tmpl_value_int_range_choices(const scf_prop_tmpl_t *prop_tmpl, scf_int_ranges_t *ranges);
ssize_t scf_tmpl_value_common_name(const scf_prop_tmpl_t *prop_tmpl, const char *locale, const char *value, char **out);
ssize_t scf_tmpl_value_description(const scf_prop_tmpl_t *prop_tmpl, const char *locale, const char *value, char **out);
int scf_tmpl_value_in_constraint(const scf_prop_tmpl_t *prop_tmpl, scf_value_t *value, scf_tmpl_errors_t **errs);
These functions retrieve the metadata about a specific property. They require that the template for the property has already been located by one of the scf_tmpl_prop_create(3SCF) suite of functions.
The scf_tmpl_prop_name() function will retrieve the property's name as currently templated and place it in *out. The caller is responsible for freeing the *out buffer on success.
The scf_tmpl_prop_type() function will retrieve the type of the property as templated and place the type in out.
The scf_tmpl_prop_required() function will determine whether the property is required in this property group and place the result of that check in out. If required is unset, out will be the default, 0. If the property is explicitly set to required, out will be 1.
The scf_tmpl_prop_common_name() function will retrieve the property's localized common name as currently templated and place it in *out. A locale (as described in setlocale(3C)) can be specified, or if the supplied locale is NULL, the current locale will be used. If a common name in the specified locale is not found, the function will also look for a common name in the C locale. Some templates will not specify the property common name. The caller is responsible for freeing the *out buffer on success.
The scf_tmpl_prop_description() function will retrieve the property's localized description as currently templated and place it in *out. A locale (as described in setlocale(3C)) can be specified, or if the supplied locale is NULL, the current locale will be used. If a description in the specified locale is not found, the function will also look for a description in the C locale. Some templates will not specify the property description. The caller is responsible for freeing the *out buffer on success.
The scf_tmpl_prop_visibility() function will retrieve the visibility of the property as currently templated and place it in out. A property can be SCF_TMPL_VISIBILITY_HIDDEN, SCF_TMPL_VISIBILITY_READONLY, or SCF_TMPL_VISIBILITY_READWRITE. If the visibility is unset, this function will return the default, SCF_TMPL_VISIBILITY_READWRITE.
The scf_tmpl_prop_cardinality() function will retrieve the minimum number of values and maximum number of values allowed for this property and place them in min and max, respectively. If the values are unset, the defaults of 0 for min and UINT64_MAX for max.
The scf_values_destroy() function destroys an scf_values_t structure and all memory associated with it.
The scf_values_t structure is populated by a number of functions. Based on the value type, it is populated with an array of the values. It is also always populated with an array of astring translations of those values.
typedef struct scf_time { int64_t t_seconds; int32_t t_ns; } scf_time_t; typedef struct scf_values { scf_type_t value_type; char *reserved; int value_count; const char **values_as_astring; union { uint64_t *v_count; uint8_t *v_boolean; int64_t *v_integer; char **v_astring; char **v_ustring; char **v_opaque; scf_time_t *v_time; } sv_data; } scf_values_t;
The scf_tmpl_prop_internal_seps() function will retrieve the list of internal separators as currently defined in the template. Each separator will be a single string character in a different element of out. Some templates will not specify any internal separators. The caller is responsible for calling scf_values_destroy() on success.
The scf_tmpl_value_name_constraints() function will retrieve the set of property values the property is expected to be part of. Some templates will not specify any constraints. The caller is responsible for calling scf_values_destroy() on success.
The scf_tmpl_value_count_range_constraints() function will retrieve the set of defined lower and upper bounds as defined by the property template and place them in ranges. Some templates will not specify any range constraints.
The scf_count_ranges_t structure is populated by the scf_tmpl_value_count_range_constraints() and scf_tmpl_value_count_range_choices() functions. scf_count_ranges_destroy() destroys an scf_count_ranges_t and all memory associated with it.
typedef struct scf_count_ranges { int scr_num_ranges; uint64_t *scr_min; uint64_t *scr_max; } scf_count_ranges_t;
The scf_tmpl_value_int_range_constraints() function will retrieve the set of defined lower and upper bounds as defined by the property template and place them in ranges. Some templates will not specify any range constraints.
The scf_int_ranges_t structure is populated by the scf_tmpl_value_int_range_constraints() and scf_tmpl_value_int_range_choices() functions. The scf_int_ranges_destroy() function destroys an scf_int_ranges_t and all memory associated with it.
typedef struct scf_int_ranges { int scr_num_ranges; int64_t *scr_min; int64_t *scr_max; } scf_int_ranges_t;
The scf_tmpl_value_name_choices() function will retrieve the set of property value choices that should be offered to a user. Some templates will not specify any choices. The caller is responsible for calling scf_values_destroy() on success.
The scf_tmpl_value_count_range_choices() function will retrieve the set of defined lower and upper bounds as defined by the property template and place them in ranges. Some templates will not specify any range choices.
The scf_tmpl_value_int_range_constraints() function will retrieve the set of defined lower and upper bounds as defined by the property template and place them in ranges. Some templates will not specify any range constraints.
The scf_tmpl_value_common_name() function will retrieve the value's common name as currently templated and place it in *out. A locale (as described in setlocale(3C)) can be specified, or if the supplied locale is NULL, the current locale will be used. If a common name in the specified locale is not found, the function will also look for a common name in the C locale. Some templates will not specify the value common name. The caller is responsible for freeing the *out buffer on success.
The scf_tmpl_value_description() function will retrieve the value's description as currently templated and place it in *out. A locale (as described in setlocale(3C)) can be specified, or if the supplied locale is NULL, the current locale will be used. If a description in the specified locale is not found, the function will also look for a description in the C locale. Some templates will not specify the value description. The caller is responsible for freeing the *out buffer on success.
The scf_tmpl_value_in_constraint() function will check that the value provided matches the constraints as defined in the property template provided. This currently means it will determine if the value provided:
is of the proper type for the property template defined,
is within a range defined, if it is a numeric type, and
is within the name constraints, if name constraints are defined.
If the template property does not define a type, ranges will be considered of the same type as the numeric values being checked. Some ranges might consider the value out of constraint when tested as one numeric type but within constraint if tested as other numeric type. Refer to strtoull(3C) and strtoll(3C) to see the implications when retrieving numeric values from the repository or converting strings to numeric values in libscf(3LIB).
If errs is not NULL, an scf_tmpl_error_t will be created, populated and added to errs in case of a constraint violation. The caller is responsible for calling scf_tmpl_errors_destroy() to free memory allocated for all scf_tmpl_error_t associated to errs.
Upon successful completion, scf_tmpl_prop_name(), scf_tmpl_prop_common_name(), scf_tmpl_prop_description(), scf_tmpl_prop_units(), scf_tmpl_value_common_name(), and scf_tmpl_value_description() return the length of the string written, not including the terminating null byte. Otherwise, they return -1.
Upon successful completion, scf_tmpl_prop_type(), scf_tmpl_prop_required(), scf_tmpl_prop_visibility(), scf_tmpl_prop_cardinality(), scf_tmpl_prop_internal_seps(), scf_tmpl_value_name_constraints(), scf_tmpl_value_count_range_constraints(), scf_tmpl_value_int_range_constraints(), scf_tmpl_value_name_choices(), scf_tmpl_value_count_range_choices(), scf_tmpl_value_int_range_choices() return 0. Otherwise, they return -1.
The scf_tmpl_value_in_constraint() functions returns 0 on success, 1 if the value is not in the constraint, and -1 on failure.
Upon successful completion, scf_tmpl_visibility_to_string() returns a string of the visibility supplied.
The scf_tmpl_prop_name(), scf_tmpl_prop_type(), scf_tmpl_prop_required(), scf_tmpl_prop_common_name(), scf_tmpl_prop_description(), scf_tmpl_prop_units(), scf_tmpl_prop_visibility(), scf_tmpl_prop_cardinality(), scf_tmpl_prop_internal_seps(), scf_tmpl_value_name_constraints(), scf_tmpl_value_count_range_constraints(), scf_tmpl_value_int_range_constraints(), scf_tmpl_value_name_choices(), scf_tmpl_value_count_range_choices(), scf_tmpl_value_int_range_choices(), scf_tmpl_value_common_name(), scf_tmpl_value_description(), and scf_tmpl_value_in_constraint() functions will fail if:
The storage mechanism that the repository server (svc.configd(1M)) chose for the operation denied access.
The connection to the repository was lost.
The template property group has been deleted.
The handle passed in has been destroyed.
An internal error occurred.
There is not enough memory to populate the scf_pg_tmpl_t.
The server does not have adequate resources to complete the request.
The handle is not currently bound.
The template could not be read due to access restrictions.
The template data is invalid.
The scf_tmpl_prop_type(), scf_tmpl_prop_common_name(), scf_tmpl_prop_description(), scf_tmpl_prop_units(), scf_tmpl_prop_cardinality(), scf_tmpl_prop_internal_seps(), scf_tmpl_value_name_constraints(), scf_tmpl_value_count_range_constraints(), scf_tmpl_value_int_range_constraints(), scf_tmpl_value_name_choices(), scf_tmpl_value_count_range_choices(), scf_tmpl_value_int_range_choices(), scf_tmpl_value_common_name(), and scf_tmpl_value_description(), functions will fail if:
The property does not exist or exists and has no value.
The scf_tmpl_value_in_constraint() function will fail if:
Value is not a valid scf_value_t.
The scf_tmpl_prop_common_name(), scf_tmpl_prop_description() and scf_tmpl_prop_units() functions will fail if:
The locale string is too long to make a property name.
The scf_tmpl_value_common_name() and scf_tmpl_value_description() functions will fail if:
The value and locale strings are too long to make a property name.
The scf_tmpl_value_count_range_constraints() and scf_tmpl_value_count_range_choices() functions will fail if:
The range has negative values.
The scf_tmpl_value_int_range_constraints() and scf_tmpl_value_int_range_choices() functions will fail if:
The range values don't fit in a int64_t.
The scf_tmpl_value_count_range_constraints(), scf_tmpl_value_int_range_constraints(), scf_tmpl_value_count_range_choices() and scf_tmpl_value_int_range_choices() functions will fail if:
A range with min value > max value is found.
See attributes(5) for descriptions of the following attributes:
|
svc.configd(1M), scf_tmpl_prop_create(3SCF), setlocale(3C), strtoll(3C), strtoull(3C), attributes(5), smf_template(5)