Lines Matching +defs:val +defs:pattern

1185 prop_get_val(scf_property_t *prop, scf_value_t *val)
1189 if (scf_property_get_value(prop, val) == SCF_SUCCESS)
2281 scf_value_t *val;
2357 val = scf_value_create(g_hndl);
2358 if (val == NULL) {
2371 scf_value_set_boolean(val, vp->sc_u.sc_count);
2374 scf_value_set_count(val, vp->sc_u.sc_count);
2377 scf_value_set_integer(val, vp->sc_u.sc_integer);
2381 if (scf_value_set_from_string(val, tp,
2390 scf_value_destroy(val);
2396 if (scf_entry_add_value(entr, val) != 0)
3271 scf_value_t *val;
3377 val = scf_value_create(lcbdata->sc_handle);
3378 if (val == NULL) {
3386 if (scf_value_set_from_string(val, SCF_TYPE_FMRI,
3391 if (scf_entry_add_value(e, val) != 0)
5001 scf_value_t *val;
5070 (val = scf_value_create(g_hndl)) == NULL) {
5132 if (scf_value_set_from_string(val, SCF_TYPE_FMRI,
5138 if (scf_entry_add_value(ent, val) != 0)
8953 safe_setprop(xmlNodePtr n, const char *name, const char *val)
8955 if (xmlSetProp(n, (const xmlChar *)name, (const xmlChar *)val) == NULL)
8969 scf_value_t *val;
8973 val = scf_value_create(g_hndl);
8974 if (val == NULL)
8977 if (prop_get_val(prop, val) != 0) {
8978 scf_value_destroy(val);
8982 len = scf_value_get_as_string(val, NULL, 0);
8988 if (scf_value_get_as_string(val, str, len + 1) < 0)
8991 scf_value_destroy(val);
11085 scf_value_t *val;
11128 (val = scf_value_create(g_hndl)) == NULL ||
11191 prop_get_val(prop, val) != 0)
11205 if (scf_value_get_boolean(val, &b) != SCF_SUCCESS)
11734 lscf_list(const char *pattern)
11804 if (pattern == NULL ||
11805 fnmatch(pattern, buf, 0) == 0)
11840 if (pattern == NULL ||
11841 fnmatch(pattern, buf, 0) == 0)
12173 scf_value_t *val;
12203 (val = scf_value_create(g_hndl)) == NULL ||
12224 prop_get_val(prop, val) != 0)
12227 if (scf_value_get_astring(val, fmri, max_scf_fmri_len + 2) < 0)
12250 scf_value_destroy(val);
12264 scf_value_t *val;
12271 (val = scf_value_create(g_hndl)) == NULL)
12282 prop_get_val(prop, val) != 0)
12285 szret = scf_value_get_astring(val, buf, sizeof (buf));
12292 scf_value_destroy(val);
12302 scf_value_t *val;
12312 (val = scf_value_create(g_hndl)) == NULL)
12317 if (scf_property_get_value(prop, val) != 0)
12319 if (scf_value_get_boolean(val, &b) != 0)
12325 (void) scf_value_destroy(val);
12721 prop_has_multiple_values(const scf_property_t *prop, scf_value_t *val)
12723 if (scf_property_get_value(prop, val) == 0) {
12743 scf_value_t *val;
12749 (val = scf_value_create(g_hndl)) == NULL)
12757 if (prop_has_multiple_values(prop, val) &&
12758 (scf_value_type(val) == SCF_TYPE_ASTRING ||
12759 scf_value_type(val) == SCF_TYPE_USTRING))
12765 while ((ret = scf_iter_next_value(iter, val)) == 1) {
12769 vlen = scf_value_get_as_string(val, NULL, 0);
12775 szret = scf_value_get_as_string(val, buf, vlen + 1);
13050 scf_value_t *val;
13054 (val = scf_value_create(g_hndl)) == NULL)
13062 while ((ret = scf_iter_next_value(iter, val)) == 1) {
13063 if (scf_value_get_as_string(val, val_buf,
13266 scf_value_t *val;
13270 (val = scf_value_create(g_hndl)) == NULL ||
13283 if (prop_get_val(prop, val) == 0 &&
13284 scf_value_get_ustring(val, common_name,
13304 if (prop_get_val(prop, val) == 0 &&
13305 scf_value_get_ustring(val, description,
13334 scf_value_destroy(val);
13339 listtmpl(const char *pattern, int templates)
13376 /* If pattern is specified, we want to list only those items. */
13379 if (pattern == NULL || (scf_tmpl_pg_name(pgt, &pg_name) > 0 &&
13380 fnmatch(pattern, pg_name, 0) == 0)) {
13400 if (listed > 0 || pattern == NULL ||
13402 fnmatch(pattern, search_name,
13424 listprop(const char *pattern, int only_pgs, int templates)
13468 * We want to only list items which match pattern, and we want the
13507 if (pattern == NULL ||
13508 fnmatch(pattern, pgnbuf, 0) == 0) {
13570 if (pattern == NULL || print_props == 1 ||
13571 fnmatch(pattern, ppnbuf, 0) == 0) {
13665 lscf_listpg(const char *pattern)
13669 listprop(pattern, 1, 0);
13812 lscf_listprop(const char *pattern)
13816 listprop(pattern, 0, 0);
14164 scf_value_t *val;
14204 (val = scf_value_create(g_hndl)) == NULL ||
14261 multiple = prop_has_multiple_values(prop, val);
14278 while ((ret3 = scf_iter_next_value(viter, val)) == 1) {
14282 buflen = scf_value_get_as_string(val, NULL, 0);
14288 if (scf_value_get_as_string(val, buf,
14359 scf_value_destroy(val);
14491 * Get all property values that don't match the given glob pattern,
14492 * if a pattern is specified.
14496 const char *pattern)
14499 scf_value_t *val;
14503 (val = scf_value_create(g_hndl)) == NULL)
14509 while ((ret = scf_iter_next_value(iter, val)) == 1) {
14513 vlen = scf_value_get_as_string(val, NULL, 0);
14519 szret = scf_value_get_as_string(val, buf, vlen + 1);
14524 if (pattern == NULL || fnmatch(pattern, buf, 0) != 0)
14533 scf_value_destroy(val);
14553 char *pattern = NULL;
14562 pattern = safe_strdup(arg);
14635 char *pat = pattern;
14736 free(pattern);
14759 lscf_delpropvalue(const char *pgname, const char *pattern, int isnotfoundok)
14761 return (lscf_setpropvalue(pgname, NULL, pattern, 0, isnotfoundok));
14862 char *pattern;
15023 pattern = uu_msprintf("%s=*", name);
15025 if (prop == NULL || pattern == NULL)
15028 ret = lscf_delpropvalue(prop, pattern, !isunset);
15031 uu_free(pattern);
15034 pattern = uu_msprintf("%s=%s", name, value);
15035 if (prop == NULL || pattern == NULL)
15037 ret = lscf_addpropvalue(prop, "astring:", pattern);
15039 uu_free(pattern);
15335 scf_value_t *val;
15385 (val = scf_value_create(g_hndl)) == NULL)
15407 scf_property_get_value(prop, val) == 0)
15408 (void) scf_value_get_boolean(val, &enabled);
15532 scf_value_destroy(val);
15618 char *pattern = NULL;
15666 pattern = argv[optind];
15680 if (pattern == NULL) {
15689 listprop(pattern, 0, 2);
15691 listprop(pattern, 0, 1);
15694 listtmpl(pattern, 2);
15696 listtmpl(pattern, 1);
15986 char *val;
16014 if ((param = strtok_r(p, "=", &val)) != NULL)
16015 if (nvlist_add_string(mech, param, val) != 0)
17359 scf_value_t *val;
17369 val = scf_value_create(g_hndl);
17371 if (pg == NULL || prop == NULL || val == NULL || iter == NULL ||
17379 uu_warn("%s\n", val == NULL ? "val is NULL" :
17380 "val is not NULL");
17452 if (scf_property_get_value(prop, val) != SCF_SUCCESS) {
17475 if (scf_value_get_astring(val, mfile, max_scf_value_len + 1)
17501 scf_value_destroy(val);