Lines Matching defs:av

840 av_destroy(avalues_t *av)
842 if (av == NULL)
844 switch (av->av_type) {
847 uu_free(av->av_v.av_unsigned);
850 uu_free(av->av_v.av_integer);
858 uu_free(av->av_v.av_string);
861 uu_free(av);
877 avalues_t *av;
879 av = uu_zalloc(sizeof (*av));
880 if (av == NULL)
882 av->av_count = count;
883 av->av_type = type;
887 av->av_v.av_unsigned = uu_zalloc(count * sizeof (uint64_t));
888 if (av->av_v.av_unsigned == NULL)
892 av->av_v.av_integer = uu_zalloc(count * sizeof (int64_t));
893 if (av->av_v.av_integer == NULL)
897 av->av_v.av_string = uu_zalloc(count * sizeof (char *));
898 if (av->av_v.av_string == NULL)
902 av_destroy(av);
905 return (av);
909 * Return the ith integer value in av.
912 av_get_integer(avalues_t *av, uint_t i)
914 assert(av->av_type == SCF_TYPE_INTEGER);
915 assert(i < av->av_count);
916 return (*(av->av_v.av_integer + i));
920 * Return the ith string value in av.
923 av_get_string(avalues_t *av, uint_t i)
925 assert(is_numeric_type(av->av_type) == 0);
926 assert(i < av->av_count);
927 return (*(av->av_v.av_string + i));
931 * Return the ith unsigned value in av.
934 av_get_unsigned(avalues_t *av, uint_t i)
936 assert((av->av_type == SCF_TYPE_BOOLEAN) ||
937 (av->av_type == SCF_TYPE_COUNT));
938 assert(i < av->av_count);
939 return (*(av->av_v.av_unsigned + i));
943 * Store the value in the ith slot of the av structure. If av is being
948 av_set_value(avalues_t *av, uint_t i, const char *value)
954 if (is_numeric_type(av->av_type)) {
955 switch (av->av_type) {
962 *(av->av_v.av_unsigned + i) = un;
969 *(av->av_v.av_integer + i) = n;
972 *(av->av_v.av_string + i) = value;
994 avalues_t *av;
1005 av = av_create(count_prop_values(prop), type);
1006 if (av == NULL)
1013 assert(i < av->av_count);
1015 rc = av_set_value(av, i, v->sc_u.sc_string);
1017 av_destroy(av);
1021 *values = av;