MCPcopy Create free account
hub / github.com/F-Stack/f-stack / NVLIST_APPEND_ARRAY

Function NVLIST_APPEND_ARRAY

freebsd/contrib/libnv/nvlist.c:1640–1673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1638}
1639
1640NVLIST_APPEND_ARRAY(const bool, bool, BOOL)
1641NVLIST_APPEND_ARRAY(const uint64_t, number, NUMBER)
1642NVLIST_APPEND_ARRAY(const char *, string, STRING)
1643NVLIST_APPEND_ARRAY(const nvlist_t *, nvlist, NVLIST)
1644#ifndef _KERNEL
1645NVLIST_APPEND_ARRAY(const int, descriptor, DESCRIPTOR)
1646#endif
1647
1648#undef NVLIST_APPEND_ARRAY
1649
1650bool
1651nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp)
1652{
1653
1654 NVPAIR_ASSERT(nvp);
1655 PJDLOG_ASSERT(nvpair_nvlist(nvp) == NULL);
1656
1657 if (nvlist_error(nvl) != 0) {
1658 nvpair_free(nvp);
1659 ERRNO_SET(nvlist_error(nvl));
1660 return (false);
1661 }
1662 if ((nvl->nvl_flags & NV_FLAG_NO_UNIQUE) == 0) {
1663 if (nvlist_exists(nvl, nvpair_name(nvp))) {
1664 nvpair_free(nvp);
1665 nvl->nvl_error = EEXIST;
1666 ERRNO_SET(nvl->nvl_error);
1667 return (false);
1668 }
1669 }
1670
1671 nvpair_insert(&nvl->nvl_head, nvp, nvl);
1672 return (true);
1673}
1674
1675void
1676nvlist_move_string(nvlist_t *nvl, const char *name, char *value)

Callers

nothing calls this directly

Calls 6

nvpair_nvlistFunction · 0.85
nvlist_errorFunction · 0.85
nvpair_insertFunction · 0.85
nvpair_freeFunction · 0.70
nvlist_existsFunction · 0.70
nvpair_nameFunction · 0.70

Tested by

no test coverage detected