John Levon wrote: > I don't get how I'm supposed to use this. It returns a const property (as it > seems it should) but all the ways to iterate over the contents use a non-const > argument. Seems pretty useless, which is why I suppose it's not used (and why > the manpage is totally wrong). > > regards > john > _______________________________________________ > smf-discuss mailing list > smf-discuss at opensolaris.org > John,
I found the below snippet of code to work fine for me and was planning to blog about the use of these interface once my code is integrated. I do agree that it's quite confusing and the manpage is not insufficient. -tony ... scf_simple_app_props_t *config_pg = NULL; scf_simple_prop_t const *pressure_prop = NULL; scf_simple_prop_t const *reconfig_int_prop = NULL; ... ... if ((config_pg = scf_simple_app_props_get(h, RCAP_FMRI)) == NULL) { warn(gettext("Failed to get configuration " "information \n")); .... .... if ((pressure_prop = scf_simple_app_props_search(config_pg, "config_params", "pressure")) == NULL && (numvals = scf_simple_prop_numvalues(pressure_prop)) <= 0) { warn(gettext("Couldn't find property `%s' in property " "group `%s'\n"), "pressure", "config_params"); goto err; } else {