Ejemplo n.º 1
0
nvpair_t *
fnvlist_lookup_nvpair(nvlist_t *nvl, const char *name)
{
	nvpair_t *rv;
	VERIFY0(nvlist_lookup_nvpair(nvl, name, &rv));
	return (rv);
}
Ejemplo n.º 2
0
void nvl_convert(nvlist_t *nvl, const struct convert_info *table)
{
	int ret;
	int i;

	/*
	 * If we weren't given a table, we have nothing to do other than the
	 * generic conversion (see above)
	 */
	if (!table)
		return;

	for (i = 0; table[i].name; i++) {
		nvpair_t *pair;

		ret = nvlist_lookup_nvpair(nvl, table[i].name, &pair);
		if (ret)
			continue;

		switch (nvpair_type(pair)) {
			case DATA_TYPE_STRING:
				cvt_string(nvl, pair, table[i].type);
				break;
			default:
				break;
		}
	}
}