// SPDX-FileCopyrightText: Matteo Settenvini // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include template inline auto set_if_valid(T *ptr, T val) -> T * { if (ptr != nullptr) { *ptr = std::move(val); } return ptr; } namespace malcontent { auto copy_hostent(const hostent& src, hostent& dst, void *buffer, size_t buflen) -> void; auto copy_hostent_to_gaih_addrtuple(const hostent& src, gaih_addrtuple *head, void *& buffer, size_t& buflen) -> gaih_addrtuple *; } // ~ namespace malcontent