Lines Matching defs:value
45 nwam_value_free(nwam_value_t value)
49 if (value == NULL)
52 switch (value->nwv_value_type) {
54 free(value->nwv_values.nwv_boolean);
57 free(value->nwv_values.nwv_int64);
60 free(value->nwv_values.nwv_uint64);
63 for (i = 0; i < value->nwv_value_numvalues; i++)
64 free(value->nwv_values.nwv_string[i]);
65 free(value->nwv_values.nwv_string);
68 free(value);
190 nwam_value_create_boolean(boolean_t value, nwam_value_t *valuep)
192 return (nwam_value_create_boolean_array(&value, 1, valuep));
204 nwam_value_create_int64(int64_t value, nwam_value_t *valuep)
206 return (nwam_value_create_int64_array(&value, 1, valuep));
218 nwam_value_create_uint64(uint64_t value, nwam_value_t *valuep)
220 return (nwam_value_create_uint64_array(&value, 1, valuep));
232 nwam_value_create_string(char *value, nwam_value_t *valuep)
234 return (nwam_value_create_string_array(&value, 1, valuep));
238 nwam_value_get_boolean_array(nwam_value_t value, boolean_t **valuesp,
241 assert(value != NULL && numvaluesp != NULL && valuesp != NULL);
243 *numvaluesp = value->nwv_value_numvalues;
244 *valuesp = value->nwv_values.nwv_boolean;
249 nwam_value_get_boolean(nwam_value_t value, boolean_t *valuep)
255 err = nwam_value_get_boolean_array(value, &myvaluesp, &numvalues);
266 nwam_value_get_int64_array(nwam_value_t value, int64_t **valuesp,
269 assert(value != NULL && numvaluesp != NULL && valuesp != NULL);
271 *numvaluesp = value->nwv_value_numvalues;
272 *valuesp = value->nwv_values.nwv_int64;
277 nwam_value_get_int64(nwam_value_t value, int64_t *valuep)
283 err = nwam_value_get_int64_array(value, &myvaluesp, &numvalues);
294 nwam_value_get_uint64_array(nwam_value_t value, uint64_t **valuesp,
297 assert(value != NULL && numvaluesp != NULL && valuesp != NULL);
299 *numvaluesp = value->nwv_value_numvalues;
300 *valuesp = value->nwv_values.nwv_uint64;
305 nwam_value_get_uint64(nwam_value_t value, uint64_t *valuep)
311 err = nwam_value_get_uint64_array(value, &myvaluesp, &numvalues);
322 nwam_value_get_string_array(nwam_value_t value, char ***valuesp,
325 assert(value != NULL && numvaluesp != NULL && valuesp != NULL);
327 *numvaluesp = value->nwv_value_numvalues;
328 *valuesp = value->nwv_values.nwv_string;
333 nwam_value_get_string(nwam_value_t value, char **valuep)
339 err = nwam_value_get_string_array(value, &myvaluesp, &numvalues);
350 nwam_value_get_type(nwam_value_t value, nwam_value_type_t *typep)
352 *typep = value->nwv_value_type;
357 nwam_value_get_numvalues(nwam_value_t value, uint_t *numvaluesp)
359 *numvaluesp = value->nwv_value_numvalues;
585 nwam_set_prop_value(void *list, const char *propname, nwam_value_t value)
596 assert(list != NULL && value != NULL);
598 if ((err = nwam_value_get_type(value, &type)) != NWAM_SUCCESS)
603 if ((err = nwam_value_get_boolean_array(value, &valbool,
611 if ((err = nwam_value_get_int64_array(value, &valint64,
619 if ((err = nwam_value_get_uint64_array(value, &valuint64,
627 if ((err = nwam_value_get_string_array(value, &valstr,
645 uint64_t value;
757 * that value. Used by enum values.
764 int max = 0; /* largest enum value seen so far */
776 if (value_entries[j].value == val) {
780 max = value_entries[j].value > max ?
781 value_entries[j].value : max;
784 * If trying to get the string for an enum value that doesn't
786 * value doesn't exist for the given property.
797 * Convert string to appropriate uint64 value.
817 *valp = value_entries[j].value;