OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
mustangpeak_endian_helper.h
Go to the documentation of this file.
1
39// This is a guard condition so that contents of this file are not included
40// more than once.
41
42#ifndef __MUSTANGPEAK_ENDIAN_HELPER__
43#define __MUSTANGPEAK_ENDIAN_HELPER__
44
45#include <stdint.h>
46
47#ifdef __cplusplus
48extern "C"
49{
50#endif /* __cplusplus */
51
62 extern uint8_t swap_endian8(uint8_t x);
63
74 extern uint16_t swap_endian16(uint16_t x);
75
86 extern uint32_t swap_endian32(uint32_t x);
87
98 extern uint64_t swap_endian64(uint64_t x);
99
100#ifdef __cplusplus
101}
102#endif /* __cplusplus */
103
104#endif /* __MUSTANGPEAK_ENDIAN_HELPER__ */
uint16_t swap_endian16(uint16_t x)
Reverses the byte order of a 16-bit unsigned integer.
Definition mustangpeak_endian_helper.c:70
uint64_t swap_endian64(uint64_t x)
Reverses the byte order of a 64-bit unsigned integer.
Definition mustangpeak_endian_helper.c:125
uint32_t swap_endian32(uint32_t x)
Reverses the byte order of a 32-bit unsigned integer.
Definition mustangpeak_endian_helper.c:99
uint8_t swap_endian8(uint8_t x)
Returns the input byte unchanged (no-op for API symmetry).
Definition mustangpeak_endian_helper.c:51

Copyright (c) 2026 Jim Kueneman all rights reserved. See the License