Lines Matching refs:val

105 static void scf_value_reset_locked(scf_value_t *val, int and_destroy);
951 uint64_t val;
952 if (scf_value_get_count(v, &val) < 0)
956 handle->rh_debug = (uid_t)val;
2961 scf_scope_handle(const scf_scope_t *val)
2963 return (datael_handle(&val->rd_d));
2967 scf_scope_destroy(scf_scope_t *val)
2969 if (val == NULL)
2972 datael_destroy(&val->rd_d);
2973 uu_free(val);
3055 scf_service_handle(const scf_service_t *val)
3057 return (datael_handle(&val->rd_d));
3138 commit_value(caddr_t data, scf_value_t *val, rep_protocol_value_type_t t)
3142 assert(val->value_type == t);
3145 len = scf_opaque_encode(data, val->value_value,
3146 val->value_size);
3149 len = strlcpy(data, val->value_value,
3152 len = strlen(val->value_value);
3524 scf_service_destroy(scf_service_t *val)
3526 if (val == NULL)
3529 datael_destroy(&val->rd_d);
3530 uu_free(val);
3563 scf_instance_handle(const scf_instance_t *val)
3565 return (datael_handle(&val->rd_d));
3569 scf_instance_destroy(scf_instance_t *val)
3571 if (val == NULL)
3574 datael_destroy(&val->rd_d);
3575 uu_free(val);
3608 scf_snapshot_handle(const scf_snapshot_t *val)
3610 return (datael_handle(&val->rd_d));
3614 scf_snapshot_destroy(scf_snapshot_t *val)
3616 if (val == NULL)
3619 datael_destroy(&val->rd_d);
3620 uu_free(val);
3653 scf_snaplevel_handle(const scf_snaplevel_t *val)
3655 return (datael_handle(&val->rd_d));
3659 scf_snaplevel_destroy(scf_snaplevel_t *val)
3661 if (val == NULL)
3664 datael_destroy(&val->rd_d);
3665 uu_free(val);
3795 scf_pg_handle(const scf_propertygroup_t *val)
3797 return (datael_handle(&val->rd_d));
3801 scf_pg_destroy(scf_propertygroup_t *val)
3803 if (val == NULL)
3806 datael_destroy(&val->rd_d);
3807 uu_free(val);
4194 scf_property_handle(const scf_property_t *val)
4196 return (datael_handle(&val->rd_d));
4200 scf_property_destroy(scf_property_t *val)
4202 if (val == NULL)
4205 datael_destroy(&val->rd_d);
4206 uu_free(val);
4533 scf_transaction_handle(const scf_transaction_t *val)
4535 return (handle_get(val->tran_pg.rd_d.rd_handle));
4999 scf_transaction_destroy(scf_transaction_t *val)
5001 if (val == NULL)
5004 scf_transaction_reset(val);
5006 datael_destroy(&val->tran_pg.rd_d);
5008 uu_list_destroy(val->tran_props);
5009 uu_free(val);
5056 scf_entry_handle(const scf_transaction_entry_t *val)
5058 return (handle_get(val->entry_handle));
5194 scf_decoration_handle(const scf_decoration_t *val)
5196 return (datael_handle(&val->rd_d));
5200 scf_decoration_destroy(scf_decoration_t *val)
5202 if (val == NULL)
5205 datael_destroy(&val->rd_d);
5206 uu_free(val);
5244 scf_value_reset_locked(scf_value_t *val, int and_destroy)
5249 scf_handle_t *h = val->value_handle;
5251 if (val->value_tx != NULL) {
5252 te = val->value_tx;
5255 val->value_tx = NULL;
5259 if (*curp == val) {
5260 *curp = val->value_next;
5267 val->value_type = REP_PROTOCOL_TYPE_INVALID;
5270 val->value_handle = NULL;
5274 uu_free(val);
5279 scf_value_reset(scf_value_t *val)
5281 scf_handle_t *h = val->value_handle;
5284 scf_value_reset_locked(val, 0);
5289 scf_value_handle(const scf_value_t *val)
5291 return (handle_get(val->value_handle));
5295 scf_value_destroy(scf_value_t *val)
5299 if (val == NULL)
5302 h = val->value_handle;
5305 scf_value_reset_locked(val, 1);
5310 scf_value_base_type(const scf_value_t *val)
5313 scf_handle_t *h = val->value_handle;
5316 t = val->value_type;
5330 scf_value_type(const scf_value_t *val)
5333 scf_handle_t *h = val->value_handle;
5336 t = val->value_type;
5343 scf_value_is_type(const scf_value_t *val, scf_type_t base_arg)
5347 scf_handle_t *h = val->value_handle;
5350 t = val->value_type;
5365 * _NOT_SET - val is reset
5366 * _TYPE_MISMATCH - val's type is not compatible with t
5369 scf_value_check_type(const scf_value_t *val, rep_protocol_value_type_t t)
5371 if (val->value_type == REP_PROTOCOL_TYPE_INVALID) {
5375 if (!scf_is_compatible_protocol_type(t, val->value_type)) {
5384 * _NOT_SET - val is reset
5385 * _TYPE_MISMATCH - val is not _TYPE_BOOLEAN
5388 scf_value_get_boolean(const scf_value_t *val, uint8_t *out)
5391 scf_handle_t *h = val->value_handle;
5395 if (!scf_value_check_type(val, REP_PROTOCOL_TYPE_BOOLEAN)) {
5400 c = val->value_value[0];
5401 assert((c == '0' || c == '1') && val->value_value[1] == 0);
5411 scf_value_get_count(const scf_value_t *val, uint64_t *out)
5413 scf_handle_t *h = val->value_handle;
5417 if (!scf_value_check_type(val, REP_PROTOCOL_TYPE_COUNT)) {
5422 o = strtoull(val->value_value, NULL, 10);
5430 scf_value_get_integer(const scf_value_t *val, int64_t *out)
5432 scf_handle_t *h = val->value_handle;
5436 if (!scf_value_check_type(val, REP_PROTOCOL_TYPE_INTEGER)) {
5441 o = strtoll(val->value_value, NULL, 10);
5449 scf_value_get_time(const scf_value_t *val, int64_t *sec_out, int32_t *nsec_out)
5451 scf_handle_t *h = val->value_handle;
5457 if (!scf_value_check_type(val, REP_PROTOCOL_TYPE_TIME)) {
5462 os = strtoll(val->value_value, &p, 10);
5478 * _NOT_SET - val is reset
5479 * _TYPE_MISMATCH - val's type is not compatible with _TYPE_STRING.
5482 scf_value_get_astring(const scf_value_t *val, char *out, size_t len)
5485 scf_handle_t *h = val->value_handle;
5488 if (!scf_value_check_type(val, REP_PROTOCOL_TYPE_STRING)) {
5492 ret = (ssize_t)strlcpy(out, val->value_value, len);
5498 scf_value_get_ustring(const scf_value_t *val, char *out, size_t len)
5501 scf_handle_t *h = val->value_handle;
5504 if (!scf_value_check_type(val, REP_PROTOCOL_SUBTYPE_USTRING)) {
5508 ret = (ssize_t)strlcpy(out, val->value_value, len);