コード例 #1
0
ファイル: subr_nvlist.c プロジェクト: fengsi/freebsd
void
nvlist_free_type(nvlist_t *nvl, const char *name, int type)
{
	nvpair_t *nvp;

	NVLIST_ASSERT(nvl);
	PJDLOG_ASSERT(nvl->nvl_error == 0);
	PJDLOG_ASSERT(type == NV_TYPE_NONE ||
	    (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST));

	nvp = nvlist_find(nvl, type, name);
	if (nvp != NULL)
		nvlist_free_nvpair(nvl, nvp);
	else
		nvlist_report_missing(type, name);
}
コード例 #2
0
ファイル: nvlist.c プロジェクト: BillTheBest/libuinet
void
nvlist_freev_type(nvlist_t *nvl, int type, const char *namefmt, va_list nameap)
{
	va_list cnameap;
	nvpair_t *nvp;

	NVLIST_ASSERT(nvl);
	PJDLOG_ASSERT(nvl->nvl_error == 0);
	PJDLOG_ASSERT(type == NV_TYPE_NONE ||
	    (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST));

	va_copy(cnameap, nameap);
	nvp = nvlist_findv(nvl, type, namefmt, cnameap);
	va_end(cnameap);
	if (nvp != NULL)
		nvlist_free_nvpair(nvl, nvp);
	else
		nvlist_report_missing(type, namefmt, nameap);
}