Lines Matching refs:NULL

174  * On failure, returns NULL and sets scf_error() to _CONNECTION_BROKEN,
184 assert(t->pt_svc != NULL || t->pt_inst != NULL);
185 assert(t->pt_svc == NULL || t->pt_inst == NULL);
187 if (buf == NULL) {
192 if (t->pt_inst != NULL)
200 buf = NULL;
216 * On failure, returns NULL and sets scf_error() to: _CONNECTION_BROKEN,
225 if (buf == NULL) {
230 buf = NULL;
246 * On error, returns NULL and sets scf_error() to _CONNECTION_BROKEN,
255 if (buf == NULL) {
260 buf = NULL;
276 * On error, returns NULL and sets scf_error() to _CONNECTION_BROKEN,
287 return (NULL);
295 if (ret == NULL)
334 assert(val != NULL);
335 if ((h = scf_pg_handle(pg)) == NULL) {
343 if (prop == NULL || *val == NULL) {
363 *val = NULL;
377 * Returns NULL on failure, sets scf_error() to:
401 char *ret = NULL;
406 return (NULL);
409 if (ret == NULL) {
417 ret = NULL;
431 * Returns NULL on failure, sets scf_error() to _BACKEND_ACCESS,
442 if (type == NULL) {
444 return (NULL);
450 return (NULL);
514 * Returns NULL on failure, sets scf_error() to:
541 assert(vals != NULL);
543 assert(vals->reserved == NULL);
548 if (vals->values.v_astring == NULL) {
550 return (NULL);
560 if ((h = scf_pg_handle(pg)) == NULL) {
562 return (NULL);
569 if (prop == NULL || val == NULL || iter == NULL) {
593 if ((aux = calloc(cursz, sizeof (char *))) == NULL) {
604 if (vals->values.v_astring[count] == NULL) {
649 if (vals->values.v_astring[i] != NULL)
651 vals->values.v_astring[i] = NULL;
654 vals->values.v_astring = NULL;
665 * Returns NULL on failure, sets scf_error() to:
685 assert(vals != NULL);
688 vals->reserved = NULL;
702 * Returns NULL on failure. Sets scf_error() to:
710 char *lname = NULL;
714 if (locale == NULL)
715 locale = setlocale(LC_MESSAGES, NULL);
717 if (loc == NULL) {
719 return (NULL);
726 if (lname == NULL) {
735 lname = NULL;
746 * pg and type can both be NULL. Returns the name of the most specific
748 * If use_type is set and pg is not NULL, a property group name for a
752 * Returns NULL on failure and sets scf_error() to:
766 if (name == NULL) {
768 return (NULL);
771 if (pg == NULL && type == NULL) {
778 } else if (pg != NULL && type != NULL) {
781 } else if (pg != NULL && type == NULL && use_type == 1) {
784 } else if (pg != NULL && type == NULL) {
787 } else if (type != NULL && pg == NULL) {
798 return (NULL);
809 * Returns NULL on failure and sets scf_error() to _CONNECTION_BROKEN,
818 if (buf == NULL) {
823 buf = NULL;
838 * template t. Returns NULL on failure and sets scf_error() to:
848 char *name = NULL, *pg_name = NULL;
852 assert(prop != NULL);
853 assert(t->pt_pg != NULL);
857 if (name == NULL) {
859 return (NULL);
862 if ((pg_name = _scf_get_pg_name(t->pt_pg)) == NULL) {
864 return (NULL);
872 return (NULL);
882 return (NULL);
903 * The handle argument is NULL, or snaphot is not a valid snapshot name
917 if (h == NULL) {
918 *snap = NULL;
922 if ((*snap = scf_snapshot_create(h)) == NULL) {
927 if (snapshot == NULL)
935 *snap = NULL;
940 *snap = NULL;
945 *snap = NULL;
966 * Returns NULL on error, sets scf_error() to:
988 char *restarter = NULL;
989 scf_instance_t *ri = NULL;
990 scf_propertygroup_t *pg = NULL;
993 assert(svc != NULL || inst != NULL);
994 assert(svc == NULL || inst == NULL);
996 if ((ri = scf_instance_create(h)) == NULL ||
997 (pg = scf_pg_create(h)) == NULL) {
1002 if (inst != NULL)
1033 if (restarter != NULL && restarter[0] == '\0') {
1035 restarter = NULL;
1036 } else if (restarter == NULL) {
1058 if (restarter == NULL) {
1061 if (restarter == NULL) {
1067 if (scf_handle_decode_fmri(h, restarter, NULL, NULL, ri, NULL, NULL,
1093 return (NULL);
1097 * Returns NULL on error, sets scf_error() to:
1119 if ((ri = scf_instance_create(h)) == NULL) {
1122 return (NULL);
1125 if (scf_handle_decode_fmri(h, SCF_INSTANCE_GLOBAL, NULL, NULL, ri,
1126 NULL, NULL,
1130 return (NULL);
1136 return (NULL);
1170 scf_instance_t *tmpl_inst = NULL;
1173 char *tg = NULL;
1175 assert(svc != NULL || inst != NULL);
1176 assert(svc == NULL || inst == NULL);
1178 if (inst != NULL)
1182 if (h == NULL)
1196 assert(p->pw_pg != NULL);
1199 if (tg == NULL || /* scf_error() was set */
1205 p->pw_pg = NULL;
1206 if (tg != NULL) {
1208 tg = NULL;
1224 if (tmpl_inst != NULL) {
1225 ret = func(NULL, tmpl_inst, p);
1234 assert(p->pw_pg != NULL);
1237 if (tg == NULL || /* scf_error() was set */
1240 p->pw_pg = NULL;
1241 if (tg != NULL) {
1243 tg = NULL;
1260 if (tmpl_inst != NULL) {
1261 ret = func(NULL, tmpl_inst, p);
1270 assert(p->pw_pg != NULL);
1273 if (tg == NULL || /* scf_error() was set */
1276 p->pw_pg = NULL;
1277 if (tg != NULL) {
1279 tg = NULL;
1297 p->pw_target = NULL;
1321 assert(svc != NULL || inst != NULL);
1322 assert(svc == NULL || inst == NULL);
1323 assert(pg != NULL);
1325 if (inst != NULL)
1336 * On error, destroy pg and set it to NULL.
1365 pg = NULL;
1395 if (pg_target == NULL) {
1456 * Returns NULL on failure, sets scf_error():
1480 scf_propertygroup_t *pg = NULL;
1485 assert(inst != NULL || svc != NULL);
1486 assert(inst == NULL || svc == NULL);
1488 if (inst != NULL)
1492 if (h == NULL) {
1493 return (NULL);
1496 if ((pg = scf_pg_create(h)) == NULL ||
1497 (iter = scf_iter_create(h)) == NULL) {
1500 return (NULL);
1512 if (*tmpl_pg_name == NULL)
1516 if (pg != NULL) {
1532 *tmpl_pg_name = _tmpl_pg_name(pg_name, NULL, 0);
1533 if (*tmpl_pg_name == NULL)
1537 if (pg != NULL) {
1549 if (pg_type != NULL && pg_name == NULL) {
1550 if (inst != NULL)
1570 if (name == NULL)
1574 if (type == NULL) {
1597 *tmpl_pg_name = _tmpl_pg_name(NULL, pg_type, 0);
1598 if (*tmpl_pg_name == NULL)
1602 if (pg != NULL) {
1613 *tmpl_pg_name = _tmpl_pg_name(NULL, NULL, 0);
1614 if (*tmpl_pg_name == NULL)
1618 if (pg != NULL) {
1631 if (*tmpl_pg_name != NULL)
1633 *tmpl_pg_name = NULL;
1634 pg = NULL;
1666 scf_snapshot_t *tmpl_snap = NULL;
1671 assert(svc != NULL || inst != NULL);
1672 assert(svc == NULL || inst == NULL);
1674 if (inst != NULL)
1678 if (h == NULL)
1681 if (p->pw_snapname != NULL) {
1688 if (pg != NULL) {
1719 char *fmribuf = NULL, *snapbuf = NULL, *pg_name = NULL, *pg_type = NULL;
1724 scf_instance_t *inst = NULL;
1725 scf_snaplevel_t *snaplvl = NULL;
1726 scf_service_t *svc = NULL;
1728 scf_snapshot_t *snap = NULL;
1729 pg_tmpl_walk_t *p = NULL;
1735 if ((h = scf_pg_handle(pg)) == NULL)
1738 if ((inst = scf_instance_create(h)) == NULL ||
1739 (svc = scf_service_create(h)) == NULL ||
1740 (snaplvl = scf_snaplevel_create(h)) == NULL) {
1744 if ((fmribuf = malloc(fbufsz)) == NULL ||
1745 (pg_name = malloc(nbufsz)) == NULL ||
1746 (pg_type = malloc(tbufsz)) == NULL ||
1747 (p = calloc(1, sizeof (pg_tmpl_walk_t))) == NULL) {
1783 * snap and snapbuf are NULL.
1785 p->pw_snapname = NULL;
1788 if ((snap = scf_snapshot_create(h)) == NULL) {
1803 if ((snapbuf = malloc(nbufsz)) == NULL) {
1827 _walk_template_instances(NULL, inst, snap,
1832 if (snapbuf == NULL) {
1836 _walk_template_instances(NULL, inst, snap,
1844 _walk_template_instances(svc, NULL, snap,
1871 if (p->pw_pg != NULL) {
1939 scf_instance_t *inst = NULL;
1940 scf_service_t *svc = NULL;
1941 scf_snapshot_t *snap = NULL;
1942 pg_tmpl_walk_t *p = NULL;
1946 assert(pg_tmpl != NULL);
1948 assert(h != NULL);
1952 if ((inst = scf_instance_create(h)) == NULL ||
1953 (svc = scf_service_create(h)) == NULL) {
1958 if (p == NULL) {
1963 ret = scf_handle_decode_fmri(h, fmri, NULL, NULL, inst, NULL,
1964 NULL, SCF_DECODE_FMRI_EXACT);
1967 svc = NULL;
1970 ret = scf_handle_decode_fmri(h, fmri, NULL, svc,
1971 NULL, NULL, NULL, SCF_DECODE_FMRI_EXACT);
1974 inst = NULL;
1997 assert(svc == NULL || inst == NULL);
1998 assert(svc != NULL || inst != NULL);
2001 if (inst != NULL) {
2002 if (snapshot == NULL || strcmp(snapshot, "running") == 0 ||
2005 if (_get_snapshot(inst, NULL, &snap) == -1)
2030 if (p->pw_pg != NULL) {
2059 * Returns NULL on failure, sets scf_error() to _CONNECTION_BROKEN,
2068 assert(t->pt_svc != NULL || t->pt_inst != NULL);
2069 assert(t->pt_svc == NULL || t->pt_inst == NULL);
2071 if ((iter = scf_iter_create(h)) == NULL) {
2072 return (NULL);
2077 if (t->pt_inst != NULL)
2081 if (t->pt_svc != NULL)
2088 return (NULL);
2099 * Returns NULL on failure, sets scf_error() to:
2106 * Handle argument is NULL, or snaphot is not a valid snapshot name.
2116 scf_iter_t *iter = NULL;
2158 t->pt_svc = NULL;
2168 t->pt_svc = NULL;
2173 return (NULL);
2179 } while (t->pt_inst == NULL && t->pt_svc == NULL);
2182 if (t->pt_inst != NULL) {
2197 * Returns NULL on failure, sets scf_error() to _INVALID_ARGUMENT
2203 scf_pg_tmpl_t *pg_tmpl = NULL;
2205 if (handle == NULL) {
2207 return (NULL);
2210 if (pg_tmpl == NULL)
2241 if (*out != NULL && *out[0] == '\0') {
2245 if (*out == NULL)
2248 if (*out == NULL) {
2288 * The handle argument is NULL, fmri is invalid, or snapshot is invalid.
2300 scf_service_t *svc = NULL;
2301 scf_instance_t *inst = NULL;
2302 scf_propertygroup_t *pg = NULL;
2303 scf_snapshot_t *snap = NULL;
2304 scf_pg_tmpl_t *pg_tmpl = NULL;
2311 if (t == NULL) {
2319 if ((svc = scf_service_create(h)) == NULL ||
2320 (inst = scf_instance_create(h)) == NULL ||
2321 (pg = scf_pg_create(h)) == NULL) {
2325 ret = scf_handle_decode_fmri(h, fmri, NULL, NULL, inst, NULL,
2326 NULL, SCF_DECODE_FMRI_EXACT);
2329 svc = NULL;
2332 ret = scf_handle_decode_fmri(h, fmri, NULL, svc,
2333 NULL, NULL, NULL, SCF_DECODE_FMRI_EXACT);
2336 inst = NULL;
2361 assert(svc == NULL || inst == NULL);
2362 assert(svc != NULL || inst != NULL);
2364 if (inst != NULL) {
2365 if (snapshot == NULL ||
2369 if (_get_snapshot(inst, NULL, &snap) == -1)
2382 snap = NULL;
2399 assert(pg_tmpl->pt_pg != NULL);
2402 if (pg_tmpl->pt_iter == NULL) {
2405 if (pg_tmpl->pt_iter == NULL) {
2435 if (pg_tmpl->pt_iter == NULL) {
2490 * If type != NULL, check if type property matches. If no
2493 if (type != NULL) {
2526 if (t == NULL)
2545 t->pt_pg = NULL;
2550 t->pt_inst = NULL;
2551 t->pt_orig_inst = NULL;
2554 t->pt_snap = NULL;
2559 t->pt_orig_svc = NULL;
2560 t->pt_svc = NULL;
2563 t->pt_iter = NULL;
2578 * Returns NULL on failure, and sets scf_error():
2598 scf_propertygroup_t *pg = NULL;
2608 if ((pg = scf_pg_create(scf_pg_handle(t->pt_pg))) == NULL)
2612 if (tmpl_prop_name == NULL) {
2637 if ((pg_type = _scf_get_pg_type(pg)) != NULL &&
2665 * Returns NULL on failure, sets scf_error() to _INVALID_ARGUMENT, or
2673 if (handle == NULL) {
2675 return (NULL);
2678 if (pt == NULL)
2717 char *pg_name = NULL;
2723 scf_propertygroup_t *pg = NULL;
2724 scf_iter_t *iter = NULL;
2727 if (t == NULL || pt == NULL) {
2732 assert(t->pt_inst == NULL || t->pt_svc == NULL);
2733 assert(t->pt_inst != NULL || t->pt_svc != NULL);
2735 if ((pg_name = malloc(size)) == NULL) {
2741 if ((h = scf_pg_handle(t->pt_pg)) == NULL)
2744 if ((pg = scf_pg_create(h)) == NULL ||
2745 (iter = scf_iter_create(h)) == NULL)
2748 if (t->pt_inst != NULL)
2752 else if (t->pt_svc != NULL)
2788 if (pg_pat == NULL) {
2856 prop_tmpl->prt_iter = NULL;
2873 if (t == NULL)
2886 t->prt_pg = NULL;
2889 t->prt_pg_name = NULL;
2892 t->prt_iter = NULL;
2895 t->prt_h = NULL;
2896 t->prt_t = NULL;
2924 * Returns NULL on failure, sets scf_error() to:
2949 if (str == NULL)
2950 return (NULL);
2952 if (lname_prop == NULL) {
2955 return (NULL);
2957 if (str == NULL)
2958 return (NULL);
2962 if (lname_prop == NULL) {
2992 assert(out != NULL);
2994 SCF_PROPERTY_TM_COMMON_NAME_PREFIX, locale)) == NULL)
3022 assert(out != NULL);
3024 SCF_PROPERTY_TM_DESCRIPTION_PREFIX, locale)) == NULL)
3114 if (*out == NULL) {
3154 if (*out != NULL && *out[0] == '\0') {
3156 *out = NULL;
3159 if (*out == NULL) {
3205 if (type != NULL && type[0] == '\0') {
3210 if (type == NULL) {
3306 assert(out != NULL);
3308 SCF_PROPERTY_TM_COMMON_NAME_PREFIX, locale)) == NULL)
3336 assert(out != NULL);
3338 SCF_PROPERTY_TM_DESCRIPTION_PREFIX, locale)) == NULL)
3365 assert(out != NULL);
3367 SCF_PROPERTY_TM_UNITS_PREFIX, locale)) == NULL)
3394 if (visibility == NULL) {
3443 if (buf == NULL) {
3447 buf = NULL;
3471 scf_value_t *val_min = NULL;
3472 scf_value_t *val_max = NULL;
3545 SCF_PROPERTY_INTERNAL_SEPARATORS, vals) == NULL) {
3597 if (ret == NULL) {
3626 * Returns NULL on failure. Sets scf_error():
3639 assert(array != NULL);
3640 assert(string != NULL);
3641 assert(sep != NULL);
3645 if (str == NULL) {
3647 return (NULL);
3650 if ((array[n] = strtok_r(str, sep, &lasts)) == NULL) {
3656 while ((token = strtok_r(NULL, sep, &lasts)) != NULL) {
3671 return (NULL);
3696 SCF_PROPERTY_TM_CHOICES_INCLUDE_VALUES, &vals)) == NULL) {
3728 if (ranges == NULL)
3734 ranges->scr_min = NULL;
3735 ranges->scr_max = NULL;
3741 if (ranges == NULL)
3747 ranges->sir_min = NULL;
3748 ranges->sir_max = NULL;
3776 char *str = NULL;
3777 uint64_t *min = NULL;
3778 uint64_t *max = NULL;
3780 assert(ranges != NULL);
3781 if ((ret = _read_astrings_values(t->prt_pg, prop, &vals)) == NULL)
3791 if (min == NULL || max == NULL) {
3798 2)) == NULL)
3817 str = NULL;
3875 char *str = NULL;
3876 int64_t *min = NULL;
3877 int64_t *max = NULL;
3879 assert(ranges != NULL);
3880 if ((ret = _read_astrings_values(t->prt_pg, prop, &vals)) == NULL)
3890 if (min == NULL || max == NULL) {
3897 == NULL)
3917 str = NULL;
4023 SCF_PROPERTY_TM_CHOICES_NAME, vals)) != NULL) {
4040 if (ret != NULL) {
4061 if (ret != NULL) {
4098 char **items = NULL;
4099 char **str = NULL;
4101 if (vals == NULL)
4119 str = NULL;
4123 str = NULL;
4127 str = NULL;
4137 if (items != NULL)
4139 if (str != NULL)
4157 * Returns NULL on failure. Sets scf_error():
4165 char *name = NULL;
4166 char *encoded = NULL;
4171 if (name == NULL || encoded == NULL) {
4175 return (NULL);
4178 if (scf_encode32(value, strlen(value), encoded, sz, NULL,
4190 return (NULL);
4197 return (NULL);
4204 return (NULL);
4211 return (NULL);
4248 char *value_name = NULL;
4251 if (value_name == NULL)
4258 if (*out == NULL)
4294 char *value_name = NULL;
4297 if (value_name == NULL)
4305 if (*out == NULL)
4375 "Type of missing property group", NULL },
4377 { "Property group has bad type", "Specified type", NULL,
4380 { "Required property missing", "Name of missing property", NULL, NULL },
4382 { "Property has bad type", "Specified property type", NULL,
4389 { "Property has illegal value", NULL, NULL, "Illegal value" },
4391 { "Property value is out of range", NULL, NULL, "Actual value" },
4394 "Instance pg_pattern type", NULL },
4396 { "Property type and value type mismatch", NULL, NULL, "Value type" },
4398 { "Value is out of range", NULL, NULL, "Value" },
4400 { "Value is not valid", NULL, NULL, "Value" },
4413 "include_values type", NULL, NULL },
4416 NULL, NULL, NULL },
4419 NULL, NULL, NULL }
4457 return (NULL);
4484 return (NULL);
4511 return (NULL);
4538 return (NULL);
4565 return (NULL);
4593 return (NULL);
4620 return (NULL);
4647 return (NULL);
4674 return (NULL);
4701 return (NULL);
4728 return (NULL);
4735 assert(err != NULL && err->te_errs != NULL &&
4736 err->te_errs->tes_fmri != NULL);
4743 assert(err != NULL);
4750 assert(err != NULL);
4757 assert(err != NULL);
4764 assert(err != NULL);
4771 assert(err != NULL);
4778 assert(err != NULL);
4785 assert(err != NULL);
4792 assert(err != NULL);
4799 assert(err != NULL);
4806 assert(err != NULL);
4834 { NULL }
4839 * Returns NULL on failure. Sets scf_error():
4848 assert(errs != NULL);
4850 if (ret == NULL) {
4852 return (NULL);
4863 if (errs->tes_errs == NULL) {
4867 return (NULL);
4886 * Returns NULL on failure. Sets scf_error():
4895 assert(fmri != NULL);
4898 if (ret == NULL) {
4900 return (NULL);
4905 if ((ret->tes_fmri = strdup(fmri)) == NULL) {
4908 return (NULL);
4912 if (ret->tes_prefix == NULL) {
4916 return (NULL);
4922 if (ret->tes_errs == NULL) {
4927 return (NULL);
4943 if (prefix == NULL)
4947 if (errs->tes_prefix == NULL) {
4968 assert(errs != NULL);
4969 assert(tmpl_fmri != NULL);
4972 if (err == NULL)
4994 * if fails return NULL and set scf_error() to:
5004 if (buf == NULL) {
5006 return (NULL);
5034 char *ev1 = NULL;
5035 char *ev2 = NULL;
5036 char *t_fmri = NULL;
5037 char *t_pg_name = NULL;
5038 char *t_pg_type = NULL;
5040 if ((t_fmri = _scf_tmpl_get_fmri(t)) == NULL)
5048 if ((ev1 = strdup(t_pg_name)) == NULL) {
5052 if ((ev2 = strdup(t_pg_type)) == NULL) {
5057 return (_scf_tmpl_add_error(errs, SCF_TERR_MISSING_PG, NULL, NULL, ev1,
5058 ev2, NULL, t_fmri, t_pg_name, t_pg_type, NULL, NULL));
5086 char *pg_name = NULL;
5087 char *ev1 = NULL;
5088 char *actual = NULL;
5089 char *t_fmri = NULL;
5090 char *t_pg_name = NULL;
5091 char *t_pg_type = NULL;
5093 if ((t_fmri = _scf_tmpl_get_fmri(t)) == NULL)
5095 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5097 if ((actual = _scf_get_pg_type(pg)) == NULL)
5105 if ((ev1 = strdup(t_pg_type)) == NULL) {
5110 return (_scf_tmpl_add_error(errs, SCF_TERR_WRONG_PG_TYPE, pg_name, NULL,
5111 ev1, NULL, actual, t_fmri, t_pg_name, t_pg_type, NULL, NULL));
5140 char *pg_name = NULL;
5141 char *ev1 = NULL;
5142 char *t_fmri = NULL;
5143 char *t_pg_name = NULL;
5144 char *t_pg_type = NULL;
5145 char *t_prop_name = NULL;
5146 char *t_prop_type = NULL;
5148 if ((t_fmri = _scf_tmpl_get_fmri(t)) == NULL)
5150 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5162 if (t_prop_type != NULL && t_prop_type[0] == '\0') {
5164 t_prop_type = NULL;
5165 } else if (t_prop_type == NULL) {
5168 if (t_prop_type == NULL)
5169 if ((t_prop_type = strdup(SCF_TMPL_WILDCARD)) == NULL) {
5173 if ((ev1 = strdup(t_prop_name)) == NULL) {
5178 return (_scf_tmpl_add_error(errs, SCF_TERR_MISSING_PROP, pg_name, NULL,
5179 ev1, NULL, NULL, t_fmri, t_pg_name, t_pg_type, t_prop_name,
5210 char *pg_name = NULL;
5211 char *prop_name = NULL;
5212 char *ev1 = NULL;
5213 char *actual = NULL;
5214 char *t_fmri = NULL;
5215 char *t_pg_name = NULL;
5216 char *t_pg_type = NULL;
5217 char *t_prop_name = NULL;
5218 char *t_prop_type = NULL;
5220 if ((t_fmri = _scf_tmpl_get_fmri(pt->prt_t)) == NULL)
5222 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5224 if ((prop_name = _scf_get_prop_name(prop)) == NULL)
5226 if ((actual = _scf_get_prop_type(prop)) == NULL)
5238 if (t_prop_type != NULL && t_prop_type[0] == '\0') {
5240 t_prop_type = NULL;
5241 } else if (t_prop_type == NULL) {
5244 if (t_prop_type == NULL)
5245 if ((t_prop_type = strdup(SCF_TMPL_WILDCARD)) == NULL) {
5249 if ((ev1 = strdup(t_prop_type)) == NULL) {
5255 prop_name, ev1, NULL, actual, t_fmri, t_pg_name, t_pg_type,
5289 char *pg_name = NULL;
5290 char *prop_name = NULL;
5291 char *s_min = NULL;
5292 char *s_max = NULL;
5293 char *num = NULL;
5294 char *t_fmri = NULL;
5295 char *t_pg_name = NULL;
5296 char *t_pg_type = NULL;
5297 char *t_prop_name = NULL;
5298 char *t_prop_type = NULL;
5300 if ((t_fmri = _scf_tmpl_get_fmri(pt->prt_t)) == NULL)
5305 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5307 if ((prop_name = _scf_get_prop_name(prop)) == NULL)
5311 /* keep pg_name = NULL and prop_name = NULL */
5324 if (t_prop_type != NULL && t_prop_type[0] == '\0') {
5326 t_prop_type = NULL;
5327 } else if (t_prop_type == NULL) {
5330 if (t_prop_type == NULL)
5331 if ((t_prop_type = strdup(SCF_TMPL_WILDCARD)) == NULL) {
5335 if (min == NULL) {
5336 if ((s_min = strdup("")) == NULL) {
5341 if ((s_min = _val_to_string(*min, 0)) == NULL) {
5346 if (max == NULL) {
5347 if ((s_max = strdup("")) == NULL) {
5352 if ((s_max = _val_to_string(*max, 0)) == NULL) {
5357 if ((num = _val_to_string(count, 0)) == NULL) {
5399 char *pg_name = NULL;
5400 char *prop_name = NULL;
5401 char *value = NULL;
5402 char *t_fmri = NULL;
5403 char *t_pg_name = NULL;
5404 char *t_pg_type = NULL;
5405 char *t_prop_name = NULL;
5406 char *t_prop_type = NULL;
5408 if ((t_fmri = _scf_tmpl_get_fmri(pt->prt_t)) == NULL)
5412 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5414 if ((prop_name = _scf_get_prop_name(prop)) == NULL)
5418 /* keep pg_name = NULL and prop_name = NULL */
5419 if ((value = _scf_value_get_as_string(val)) == NULL)
5423 /* keep pg_name = NULL and prop_name = NULL */
5427 NULL) {
5443 if (t_prop_type != NULL && t_prop_type[0] == '\0') {
5445 t_prop_type = NULL;
5446 } else if (t_prop_type == NULL) {
5449 if (t_prop_type == NULL)
5450 if ((t_prop_type = strdup(SCF_TMPL_WILDCARD)) == NULL) {
5455 return (_scf_tmpl_add_error(errs, type, pg_name, prop_name, NULL, NULL,
5489 char *pg_name = NULL;
5490 char *prop_name = NULL;
5491 char *s_min = NULL;
5492 char *s_max = NULL;
5493 char *value = NULL;
5494 char *t_fmri = NULL;
5495 char *t_pg_name = NULL;
5496 char *t_pg_type = NULL;
5497 char *t_prop_name = NULL;
5498 char *t_prop_type = NULL;
5500 if ((t_fmri = _scf_tmpl_get_fmri(pt->prt_t)) == NULL)
5505 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5507 if ((prop_name = _scf_get_prop_name(prop)) == NULL)
5511 /* keep pg_name = NULL and prop_name = NULL */
5524 if (t_prop_type != NULL && t_prop_type[0] == '\0') {
5526 t_prop_type = NULL;
5527 } else if (t_prop_type == NULL) {
5530 if (t_prop_type == NULL)
5531 if ((t_prop_type = strdup(SCF_TMPL_WILDCARD)) == NULL) {
5535 if (min == NULL) {
5536 if ((s_min = strdup("")) == NULL) {
5541 if ((s_min = _val_to_string(*((uint64_t *)min), 1)) == NULL) {
5546 if (max == NULL) {
5547 if ((s_max = strdup("")) == NULL) {
5552 if ((s_max = _val_to_string(*((uint64_t *)max), 1)) == NULL) {
5557 if ((value = _val_to_string((uint64_t)val, 1)) == NULL) {
5597 char *ev1 = NULL;
5598 char *ev2 = NULL;
5599 char *t_fmri = NULL;
5600 char *t_pg_name = NULL;
5601 char *t_pg_type = NULL;
5603 if ((t_fmri = _scf_tmpl_get_fmri(r)) == NULL)
5618 return (_scf_tmpl_add_error(errs, SCF_TERR_PG_REDEFINE, NULL, NULL,
5619 ev1, ev2, NULL, t_fmri, t_pg_name, t_pg_type, NULL, NULL));
5719 if (errs != NULL) {
5720 if (pg == NULL && prop == NULL) {
5722 SCF_TERR_PROP_TYPE_MISMATCH, NULL, pt,
5723 NULL, value) == -1)
5787 if (vstr == NULL) {
5811 for (n = 0; constraints[n] != NULL; ++n) {
5827 if (ret == 1 && errs != NULL) {
5836 if (pg == NULL && prop == NULL)
5845 if (pg == NULL && prop == NULL)
5854 if (pg == NULL && prop == NULL)
5884 scf_tmpl_errors_t *e = NULL;
5886 if (errs != NULL) {
5889 if ((fmri = _scf_tmpl_get_fmri(pt->prt_t)) == NULL)
5893 if (*errs == NULL)
5898 return (_value_in_constraint(NULL, NULL, pt, value, e));
5905 assert(errs->tes_errs[errs->tes_index] != NULL);
5908 return (NULL);
5933 if (err->te_errs->tes_prefix != NULL) {
5938 buf = (sz > 0) ? s + nsz : NULL;
5945 buf = (sz > 0) ? s + nsz : NULL;
5947 for (i = 0; _tmpl_error_items[i].get_desc != NULL; ++i) {
5948 if ((str = _tmpl_error_items[i].get_desc(err)) == NULL)
5953 (val == NULL) ? "" : val);
5956 buf = (sz > 0) ? s + nsz : NULL;
5982 scf_iter_t *iter = NULL;
5983 scf_value_t *val = NULL;
6001 if (h == NULL) {
6008 if (iter == NULL || val == NULL) {
6071 scf_iter_t *iter = NULL;
6072 scf_value_t *val = NULL;
6077 if (h == NULL) {
6084 if (iter == NULL || val == NULL) {
6195 scf_prop_tmpl_t *pt = NULL;
6196 char *pg_type = NULL;
6197 scf_iter_t *iter = NULL;
6199 scf_property_t *prop = NULL;
6202 char *prop_name = NULL;
6206 assert(pg_name != NULL);
6207 assert(t != NULL);
6208 assert(pg != NULL);
6209 assert(type != NULL);
6212 if ((h = scf_pg_handle(pg)) == NULL) {
6216 if ((pt = scf_tmpl_prop_create(h)) == NULL) {
6221 if ((prop = scf_property_create(h)) == NULL) {
6226 if ((iter = scf_iter_create(h)) == NULL) {
6230 if ((prop_name = malloc(nsize)) == NULL) {
6247 if (pg_type != NULL) {
6301 prop_name = NULL;
6343 prop_name = NULL;
6392 scf_pg_tmpl_t *t = NULL;
6393 scf_pg_tmpl_t *r = NULL;
6394 char *pg_name = NULL;
6395 char *pg_name_r = NULL;
6396 char *pg_type = NULL;
6397 char *pg_type_r = NULL;
6398 char *target = NULL;
6404 if (t == NULL || r == NULL)
6407 while ((ret = scf_tmpl_iter_pgs(t, fmri, snapname, NULL,
6425 pg_name_r = NULL;
6435 pg_name_r = NULL;
6437 pg_type_r = NULL;
6441 target = NULL;
6451 pg_name_r = NULL;
6453 pg_type_r = NULL;
6455 target = NULL;
6459 pg_name_r = NULL;
6461 pg_type_r = NULL;
6463 target = NULL;
6471 pg_name = NULL;
6472 pg_type = NULL;
6532 scf_pg_tmpl_t *t = NULL;
6533 scf_iter_t *iter = NULL;
6534 scf_propertygroup_t *pg = NULL;
6535 scf_instance_t *inst = NULL;
6536 scf_snapshot_t *snap = NULL;
6537 char *type = NULL;
6538 char *pg_name = NULL;
6544 assert(errs != NULL);
6546 if ((*errs = _scf_create_errors(fmri, 1)) == NULL)
6549 if ((pg = scf_pg_create(h)) == NULL ||
6550 (iter = scf_iter_create(h)) == NULL ||
6551 (inst = scf_instance_create(h)) == NULL ||
6552 (t = scf_tmpl_pg_create(h)) == NULL) {
6561 if ((type = malloc(rsize)) == NULL ||
6562 (pg_name = malloc(nsize)) == NULL) {
6567 if (scf_handle_decode_fmri(h, fmri, NULL, NULL, inst, NULL, NULL,
6588 if (snapshot == NULL || strcmp(snapshot, "running") == 0 ||
6590 if (_get_snapshot(inst, NULL, &snap) == -1)
6669 while ((r = scf_tmpl_iter_pgs(t, fmri, snapshot, NULL,
6688 if (_get_pg(NULL, inst, snap, pg_name, pg) != 0) {
6729 *errs = NULL;
6749 if (errs == NULL)
6777 assert(err != NULL);
6802 assert(err != NULL);
6827 assert(err != NULL);
6840 if (err->te_tmpl_pg_name != NULL &&
6841 err->te_tmpl_pg_type != NULL) {
6842 if (name != NULL)
6844 if (type != NULL)
6859 assert(err != NULL);
6862 if (err->te_pg_name != NULL &&
6863 err->te_actual != NULL) {
6864 if (name != NULL)
6866 if (type != NULL)
6876 if (err->te_pg_name != NULL &&
6877 err->te_tmpl_pg_type != NULL) {
6878 if (name != NULL)
6880 if (type != NULL)
6893 if (err->te_ev1 != NULL && err->te_ev2 != NULL) {
6894 if (name != NULL)
6896 if (type != NULL)
6911 assert(err != NULL);
6921 if (err->te_tmpl_prop_name != NULL &&
6922 err->te_tmpl_prop_type != NULL) {
6923 if (name != NULL)
6925 if (type != NULL)
6944 assert(err != NULL);
6950 if (err->te_prop_name != NULL &&
6951 err->te_tmpl_prop_type != NULL) {
6952 if (name != NULL)
6954 if (type != NULL)
6977 assert(err != NULL);
6983 if (err->te_actual != NULL) {
6984 if (val != NULL)