Lines Matching refs:errs

4838  * Allocate a new scf_tmpl_error_t and add it to the errs list provided.
4843 _create_error(scf_tmpl_errors_t *errs)
4848 assert(errs != NULL);
4855 ret->te_errs = errs;
4857 assert(errs->tes_num_errs <= errs->tes_errs_size);
4858 if (errs->tes_num_errs == errs->tes_errs_size) {
4860 saved_errs = errs->tes_errs;
4861 errs->tes_errs = calloc(2 * errs->tes_errs_size,
4863 if (errs->tes_errs == NULL) {
4865 errs->tes_errs = saved_errs;
4869 (void) memcpy(errs->tes_errs, saved_errs, errs->tes_errs_size *
4871 errs->tes_errs_size = 2 * errs->tes_errs_size;
4875 errs->tes_errs[errs->tes_num_errs] = ret;
4876 errs->tes_num_errs++;
4940 _scf_tmpl_error_set_prefix(scf_tmpl_errors_t *errs, const char *prefix)
4942 free((void *) errs->tes_prefix);
4944 errs->tes_prefix = strdup("");
4946 errs->tes_prefix = strdup(prefix);
4947 if (errs->tes_prefix == NULL) {
4960 _scf_tmpl_add_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
4968 assert(errs != NULL);
4971 err = _create_error(errs);
5032 _add_tmpl_missing_pg_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t)
5057 return (_scf_tmpl_add_error(errs, SCF_TERR_MISSING_PG, NULL, NULL, ev1,
5083 _add_tmpl_wrong_pg_type_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t,
5110 return (_scf_tmpl_add_error(errs, SCF_TERR_WRONG_PG_TYPE, pg_name, NULL,
5137 _add_tmpl_missing_prop_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t,
5178 return (_scf_tmpl_add_error(errs, SCF_TERR_MISSING_PROP, pg_name, NULL,
5207 _add_tmpl_wrong_prop_type_error(scf_tmpl_errors_t *errs,
5254 return (_scf_tmpl_add_error(errs, SCF_TERR_WRONG_PROP_TYPE, pg_name,
5285 _add_tmpl_count_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5362 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, s_min,
5394 _add_tmpl_constraint_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5455 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, NULL, NULL,
5485 _add_tmpl_int_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5562 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, s_min,
5594 _add_tmpl_pg_redefine_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t,
5618 return (_scf_tmpl_add_error(errs, SCF_TERR_PG_REDEFINE, NULL, NULL,
5672 * error is appended to "errs". pg and prop, if supplied, are used to
5690 const scf_prop_tmpl_t *pt, scf_value_t *value, scf_tmpl_errors_t *errs)
5719 if (errs != NULL) {
5721 if (_add_tmpl_constraint_error(errs,
5827 if (ret == 1 && errs != NULL) {
5840 if (_add_tmpl_count_error(errs, terr_type, pg, pt,
5849 if (_add_tmpl_int_error(errs, terr_type, pg, pt, prop,
5858 if (_add_tmpl_constraint_error(errs, terr_type, pg,
5882 scf_tmpl_errors_t **errs)
5886 if (errs != NULL) {
5891 *errs = _scf_create_errors(fmri, 1);
5893 if (*errs == NULL)
5895 e = *errs;
5902 scf_tmpl_next_error(scf_tmpl_errors_t *errs)
5904 if (errs->tes_index < errs->tes_num_errs) {
5905 assert(errs->tes_errs[errs->tes_index] != NULL);
5906 return (errs->tes_errs[errs->tes_index++]);
5913 scf_tmpl_reset_errors(scf_tmpl_errors_t *errs)
5915 errs->tes_index = 0;
5978 scf_property_t *prop, scf_tmpl_errors_t *errs)
6039 if (_add_tmpl_count_error(errs, SCF_TERR_CARDINALITY_VIOLATION,
6066 scf_property_t *prop, scf_tmpl_errors_t *errs)
6112 if (_add_tmpl_wrong_prop_type_error(errs, pg, pt,
6131 if (_validate_cardinality(pg, pt, prop, errs) == -1)
6146 if (_value_in_constraint(pg, prop, pt, val, errs) == -1) {
6193 char *type, scf_tmpl_errors_t *errs)
6250 if (_add_tmpl_wrong_pg_type_error(errs, t, pg) == -1)
6286 if (_check_property(pt, pg, prop, errs) != 0)
6325 if (_add_tmpl_missing_prop_error(errs, t, pg,
6390 const char *snapname, scf_tmpl_errors_t *errs)
6447 if (_add_tmpl_pg_redefine_error(errs, t,
6530 scf_tmpl_errors_t **errs, int flags)
6544 assert(errs != NULL);
6546 if ((*errs = _scf_create_errors(fmri, 1)) == NULL)
6600 if (_scf_tmpl_check_pg_redef(h, fmri, snapshot, *errs) != 0) {
6652 if (_check_pg(t, pg, pg_name, type, *errs) != 0)
6693 if (_add_tmpl_missing_pg_error(*errs, t) == -1)
6723 if ((*errs)->tes_num_errs > 0)
6728 scf_tmpl_errors_destroy(*errs);
6729 *errs = NULL;
6744 scf_tmpl_errors_destroy(scf_tmpl_errors_t *errs)
6749 if (errs == NULL)
6752 for (i = 0; i < errs->tes_num_errs; ++i) {
6753 e = errs->tes_errs[i];
6754 if (errs->tes_flag != 0) {
6768 free((char *)errs->tes_fmri);
6769 free((char *)errs->tes_prefix);
6770 free(errs->tes_errs);
6771 free(errs);