Lines Matching defs:type

213  * type.  The string must be freed with free().
272 * Given a property, returns the type in an allocated string. The string must
281 scf_type_t type;
284 if (scf_property_type(prop, &type) == -1) {
293 ret = strdup(scf_type_to_string(type));
427 * Reads the property type and returns it as an allocated string. The string
437 char *type;
439 type = _scf_read_single_astring_from_pg(pt->prt_pg,
441 if (type == NULL) {
459 return (type);
742 * char *_tmpl_pg_name(pg, type, use_type)
744 * pg and type can both be NULL. Returns the name of the most specific
747 * property group template that has type defined is returned, even if no
748 * type is provided.
757 _tmpl_pg_name(const char *pg, const char *type, int use_type)
769 if (pg == NULL && type == NULL) {
776 } else if (pg != NULL && type != NULL) {
779 } else if (pg != NULL && type == NULL && use_type == 1) {
782 } else if (pg != NULL && type == NULL) {
785 } else if (type != NULL && pg == NULL) {
787 SCF_PG_TM_PG_PATTERN_T_PREFIX, type);
1447 * name and type, name only, type only, and completely wildcarded
1479 char *name, *type;
1501 * could match the supplied name and type. We do this
1506 /* First look for a template with name and type set and matching. */
1525 * type matches.
1544 /* Next, see if there's an "nt" template where the type matches. */
1563 /* Make sure this is a name and type specified pg. */
1568 type = _scf_read_single_astring_from_pg(pg,
1570 if (type == NULL) {
1574 if (strcmp(pg_type, type) == 0 &&
1577 free(type);
1580 free(type);
1762 /* Parent type doesn't match. Keep looking. */
1905 * Get a template by a combination of the name and type. Either name
1906 * or type can be null, which indicates a wildcard. flags may be
2018 * - check for a tm_pg_pattern_nt_<name> matching type
2019 * - check for a tm_pg_pattern_t_<type> matching type
2071 /* Iterate on property groups of type template_pg_pattern */
2216 * Retrieves name or type of a template pg.
2294 const char *type, int flags)
2487 * If type != NULL, check if type property matches. If no
2488 * type property exists, consider it a match.
2490 if (type != NULL) {
2493 == 0 || strcmp(type, tmpl_type) == 0) {
2588 * Matching template object is the wrong type in the repository.
2631 * We've only found a template property group if the type
2909 * an improper repository format and is not type astring or has
3115 * 'type' property doesn't exist or exists and has no value.
3118 * 'type' property is not SCF_TYPE_ASTRING or has more than one value.
3266 * 'type' property doesn't exist or exists and has no value.
3269 * 'type' property is not SCF_TYPE_ASTRING, has more than one value,
3275 char *type;
3277 type = _scf_read_single_astring_from_pg(t->prt_pg,
3279 if (type != NULL && type[0] == '\0') {
3280 free(type);
3284 if (type == NULL) {
3304 *out = scf_string_to_type(type);
3305 free(type);
4435 * pg_pattern type="err->tmpl_pg_type"
4437 * prop_pattern type="err->tmpl_prop_type"
4439 * To add a new error type, include scf_tmpl_error_type_t in libscf.h
4488 { "Property group has bad type", "Specified type", NULL,
4489 "Actual type" },
4493 { "Property has bad type", "Specified property type", NULL,
4494 "Actual property type" },
4505 "Instance pg_pattern type", NULL },
4507 { "Property type and value type mismatch", NULL, NULL, "Value type" },
4514 "pg_pattern name", "pg_pattern type" },
4517 "prop_pattern name", "prop_pattern type" },
4521 "pg_pattern type" },
4524 "include_values type", NULL, NULL },
4526 { "Required pg_pattern is missing a name or type attribute",
4529 { "Required prop_pattern is missing a type attribute",
4541 static const char *em_tmpl_pg_type = "pg_pattern type";
4543 static const char *em_tmpl_prop_type = "prop_pattern type";
5071 _scf_tmpl_add_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5086 err->te_type = type;
5396 _add_tmpl_count_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
5413 switch (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,
5521 switch (type) {
5535 /* use value for value 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,
5614 switch (type) {
5673 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, s_min,
5803 scf_type_t type, tmpl_type;
5818 type = scf_value_type(value);
5819 if (type == SCF_TYPE_INVALID) {
5824 /* Check if template type matches value type. */
5827 /* type is not wildcarded */
5829 } else if (tmpl_type != type) {
5842 switch (type) {
5913 r = scf_value_get_as_string_typed(value, type, vstr, sz);
6209 /* Check type */
6214 /* If required, type must be specified. */
6231 * an invalid property type.
6304 char *type, scf_tmpl_errors_t *errs)
6320 assert(type != NULL);
6359 if (strcmp(pg_type, type) != 0 &&
6423 /* required properties cannot have type wildcarded */
6648 char *type = NULL;
6672 if ((type = malloc(rsize)) == NULL ||
6735 if (scf_pg_get_type(pg, type, rsize) == -1) {
6744 if (scf_tmpl_get_by_pg_name(fmri, snapshot, pg_name, type, t,
6761 if (_check_pg(t, pg, pg_name, type, *errs) != 0)
6781 free(type);
6785 if (scf_tmpl_pg_type(t, &type) == -1)
6789 * wildcarded name or type
6792 strcmp(type, SCF_TMPL_WILDCARD) == 0) {
6841 free(type);
6909 scf_tmpl_error_type(const scf_tmpl_error_t *err, scf_tmpl_error_type_t *type)
6924 *type = err->te_type;
6934 scf_tmpl_error_pg_tmpl(const scf_tmpl_error_t *err, char **name, char **type)
6953 if (type != NULL)
6954 *type = (char *)err->te_tmpl_pg_type;
6966 scf_tmpl_error_pg(const scf_tmpl_error_t *err, char **name, char **type)
6975 if (type != NULL)
6976 *type = (char *)err->te_actual;
6989 if (type != NULL)
6990 *type = (char *)err->te_tmpl_pg_type;
7005 if (type != NULL)
7006 *type = (char *)err->te_ev2;
7018 scf_tmpl_error_prop_tmpl(const scf_tmpl_error_t *err, char **name, char **type)
7034 if (type != NULL)
7035 *type = (char *)err->te_tmpl_prop_type;
7051 scf_tmpl_error_prop(const scf_tmpl_error_t *err, char **name, char **type)
7063 if (type != NULL)
7064 *type = (char *)err->te_tmpl_prop_type;