Lines Matching defs:errs

4949  * Allocate a new scf_tmpl_error_t and add it to the errs list provided.
4954 _create_error(scf_tmpl_errors_t *errs)
4959 assert(errs != NULL);
4966 ret->te_errs = errs;
4968 assert(errs->tes_num_errs <= errs->tes_errs_size);
4969 if (errs->tes_num_errs == errs->tes_errs_size) {
4971 saved_errs = errs->tes_errs;
4972 errs->tes_errs = calloc(2 * errs->tes_errs_size,
4974 if (errs->tes_errs == NULL) {
4976 errs->tes_errs = saved_errs;
4980 (void) memcpy(errs->tes_errs, saved_errs, errs->tes_errs_size *
4982 errs->tes_errs_size = 2 * errs->tes_errs_size;
4986 errs->tes_errs[errs->tes_num_errs] = ret;
4987 errs->tes_num_errs++;
5051 _scf_tmpl_error_set_prefix(scf_tmpl_errors_t *errs, const char *prefix)
5053 free((void *) errs->tes_prefix);
5055 errs->tes_prefix = strdup("");
5057 errs->tes_prefix = strdup(prefix);
5058 if (errs->tes_prefix == NULL) {
5071 _scf_tmpl_add_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5079 assert(errs != NULL);
5082 err = _create_error(errs);
5143 _add_tmpl_missing_pg_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t)
5168 return (_scf_tmpl_add_error(errs, SCF_TERR_MISSING_PG, NULL, NULL, ev1,
5194 _add_tmpl_wrong_pg_type_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t,
5221 return (_scf_tmpl_add_error(errs, SCF_TERR_WRONG_PG_TYPE, pg_name, NULL,
5248 _add_tmpl_missing_prop_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t,
5289 return (_scf_tmpl_add_error(errs, SCF_TERR_MISSING_PROP, pg_name, NULL,
5318 _add_tmpl_wrong_prop_type_error(scf_tmpl_errors_t *errs,
5365 return (_scf_tmpl_add_error(errs, SCF_TERR_WRONG_PROP_TYPE, pg_name,
5396 _add_tmpl_count_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5473 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, s_min,
5505 _add_tmpl_constraint_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5566 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, NULL, NULL,
5596 _add_tmpl_int_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5673 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, s_min,
5705 _add_tmpl_pg_redefine_error(scf_tmpl_errors_t *errs, scf_pg_tmpl_t *t,
5729 return (_scf_tmpl_add_error(errs, SCF_TERR_PG_REDEFINE, NULL, NULL,
5783 * error is appended to "errs". pg and prop, if supplied, are used to
5801 const scf_prop_tmpl_t *pt, scf_value_t *value, scf_tmpl_errors_t *errs)
5830 if (errs != NULL) {
5832 if (_add_tmpl_constraint_error(errs,
5938 if (ret == 1 && errs != NULL) {
5951 if (_add_tmpl_count_error(errs, terr_type, pg, pt,
5960 if (_add_tmpl_int_error(errs, terr_type, pg, pt, prop,
5969 if (_add_tmpl_constraint_error(errs, terr_type, pg,
5993 scf_tmpl_errors_t **errs)
5997 if (errs != NULL) {
6002 *errs = _scf_create_errors(fmri, 1);
6004 if (*errs == NULL)
6006 e = *errs;
6013 scf_tmpl_next_error(scf_tmpl_errors_t *errs)
6015 if (errs->tes_index < errs->tes_num_errs) {
6016 assert(errs->tes_errs[errs->tes_index] != NULL);
6017 return (errs->tes_errs[errs->tes_index++]);
6024 scf_tmpl_reset_errors(scf_tmpl_errors_t *errs)
6026 errs->tes_index = 0;
6089 scf_property_t *prop, scf_tmpl_errors_t *errs)
6150 if (_add_tmpl_count_error(errs, SCF_TERR_CARDINALITY_VIOLATION,
6177 scf_property_t *prop, scf_tmpl_errors_t *errs)
6223 if (_add_tmpl_wrong_prop_type_error(errs, pg, pt,
6242 if (_validate_cardinality(pg, pt, prop, errs) == -1)
6257 if (_value_in_constraint(pg, prop, pt, val, errs) == -1) {
6304 char *type, scf_tmpl_errors_t *errs)
6361 if (_add_tmpl_wrong_pg_type_error(errs, t, pg) == -1)
6397 if (_check_property(pt, pg, prop, errs) != 0)
6436 if (_add_tmpl_missing_prop_error(errs, t, pg,
6501 const char *snapname, scf_tmpl_errors_t *errs)
6558 if (_add_tmpl_pg_redefine_error(errs, t,
6641 scf_tmpl_errors_t **errs, int flags)
6655 assert(errs != NULL);
6657 if ((*errs = _scf_create_errors(fmri, 1)) == NULL)
6709 if (_scf_tmpl_check_pg_redef(h, fmri, snapshot, *errs) != 0) {
6761 if (_check_pg(t, pg, pg_name, type, *errs) != 0)
6802 if (_add_tmpl_missing_pg_error(*errs, t) == -1)
6832 if ((*errs)->tes_num_errs > 0)
6837 scf_tmpl_errors_destroy(*errs);
6838 *errs = NULL;
6853 scf_tmpl_errors_destroy(scf_tmpl_errors_t *errs)
6858 if (errs == NULL)
6861 for (i = 0; i < errs->tes_num_errs; ++i) {
6862 e = errs->tes_errs[i];
6863 if (errs->tes_flag != 0) {
6877 free((char *)errs->tes_fmri);
6878 free((char *)errs->tes_prefix);
6879 free(errs->tes_errs);
6880 free(errs);