3 * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
5 * This file is free software; you can redistribute it and/or modify
6 * it under the terms of either the GNU General Public License version 2
7 * or the GNU Lesser General Public License version 2.1, both as
8 * published by the Free Software Foundation.
11 #include "byteordering.h"
14 * \addtogroup byteordering
16 * Architecture-dependent handling of byte-ordering.
22 * Byte-order handling implementation (license: GPLv2 or LGPLv2.1)
24 * \author Roland Riegel
29 * Converts a 16-bit integer to little-endian byte order.
31 * Use this function on variable values instead of the
32 * macro HTOL16(). This saves code size.
34 * \param[in] h A 16-bit integer in host byte order.
35 * \returns The given 16-bit integer converted to little-endian byte order.
37 uint16_t htol16(uint16_t h)
45 * Converts a 32-bit integer to little-endian byte order.
47 * Use this function on variable values instead of the
48 * macro HTOL32(). This saves code size.
50 * \param[in] h A 32-bit integer in host byte order.
51 * \returns The given 32-bit integer converted to little-endian byte order.
53 uint32_t htol32(uint32_t h)