Loading...
Searching...
No Matches
byteswap.hpp
Go to the documentation of this file.
//
// Copyright 2010-2011 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/types/endianness.hpp>
#include <stdint.h>
namespace uhd {
uint16_t byteswap(uint16_t);
uint32_t byteswap(uint32_t);
uint64_t byteswap(uint64_t);
template <typename T>
T ntohx(T);
template <typename T>
T htonx(T);
//
// The argument is assumed to be little-endian (i.e, the inverse
// of typical network endianness).
template <typename T>
T wtohx(T);
//
// The return value is little-endian (i.e, the inverse
// of typical network endianness).
template <typename T>
T htowx(T);
} // namespace uhd
#include <uhd/utils/byteswap.ipp>
byteswap.ipp
config.hpp
endianness.hpp
uhd
Definition build_info.hpp:12
uhd::ntohx
T ntohx(T)
network to host: short, long, or long-long
Definition byteswap.ipp:112
uhd::byteswap
uint16_t byteswap(uint16_t)
perform a byteswap on a 16 bit integer
Definition byteswap.ipp:87
uhd::htowx
T htowx(T)
host to worknet: short, long, or long-long
Definition byteswap.ipp:142
uhd::wtohx
T wtohx(T)
worknet to host: short, long, or long-long
Definition byteswap.ipp:132
uhd::htonx
T htonx(T)
host to network: short, long, or long-long
Definition byteswap.ipp:122