swab.h File Reference
`#include <sys/types.h>`
Include dependency graph for swab.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define | swab16(x)
| The swab16 macro. More...
#define | swab32(x)
| The swab32 macro. More...
#define | swab64(x)
| The swab64 macro. More...

## Macro Definition Documentation

## swab16

#define swab16 | ( |  | x | ) |

Value:
({ \
uint16_t __x = (x); \
((uint16_t)( \
(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
})

The swab16 macro.

Parameters

  x |

Definition at line 39 of file swab.h.

## swab32

#define swab32 | ( |  | x | ) |

Value:
({ \
uint32_t __x = (x); \
((uint32_t)( \
(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
})

The swab32 macro.

Parameters

  x |

Definition at line 51 of file swab.h.

## swab64

#define swab64 | ( |  | x | ) |

Value:
({ \
uint64_t __x = (x); \
((uint64_t)( \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
})

The swab64 macro.

Parameters

  x |

Definition at line 65 of file swab.h.