| 1638 | } |
| 1639 | |
| 1640 | NVLIST_APPEND_ARRAY(const bool, bool, BOOL) |
| 1641 | NVLIST_APPEND_ARRAY(const uint64_t, number, NUMBER) |
| 1642 | NVLIST_APPEND_ARRAY(const char *, string, STRING) |
| 1643 | NVLIST_APPEND_ARRAY(const nvlist_t *, nvlist, NVLIST) |
| 1644 | #ifndef _KERNEL |
| 1645 | NVLIST_APPEND_ARRAY(const int, descriptor, DESCRIPTOR) |
| 1646 | #endif |
| 1647 | |
| 1648 | #undef NVLIST_APPEND_ARRAY |
| 1649 | |
| 1650 | bool |
| 1651 | nvlist_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 | |
| 1675 | void |
| 1676 | nvlist_move_string(nvlist_t *nvl, const char *name, char *value) |
nothing calls this directly
no test coverage detected