CAEN Utility  2.0.2
Utilities for CAEN projects
Portable host to Network conversion functions

Platform independent functions to convert integer formats. More...

Functions

static uint16_t c_hton16 (uint16_t x)
 
static uint16_t c_ntoh16 (uint16_t x)
 
static uint32_t c_hton32 (uint32_t x)
 
static uint32_t c_ntoh32 (uint32_t x)
 
static uint64_t c_hton64 (uint64_t x)
 
static uint64_t c_ntoh64 (uint64_t x)
 

Detailed Description

Platform independent functions to convert integer formats.

Note
Defined static inline to help optimization: it is fine, as they use only standard functions.
Precondition
On Linux, these macros require __DEFAULT_SOURCE to be defined ( DEFAULT_SOURCE is defined also by _GNU_SOURCE and -std=gnuXY)
See also
https://man7.org/linux/man-pages/man3/endian.3.html

Function Documentation

◆ c_hton16()

static uint16_t c_hton16 ( uint16_t  x)
inlinestatic

Definition at line 337 of file CAENMultiplatform.h.

Here is the caller graph for this function:

◆ c_ntoh16()

static uint16_t c_ntoh16 ( uint16_t  x)
inlinestatic

Definition at line 345 of file CAENMultiplatform.h.

Here is the caller graph for this function:

◆ c_hton32()

static uint32_t c_hton32 ( uint32_t  x)
inlinestatic

Definition at line 353 of file CAENMultiplatform.h.

Here is the caller graph for this function:

◆ c_ntoh32()

static uint32_t c_ntoh32 ( uint32_t  x)
inlinestatic

Definition at line 361 of file CAENMultiplatform.h.

Here is the caller graph for this function:

◆ c_hton64()

static uint64_t c_hton64 ( uint64_t  x)
inlinestatic

Definition at line 369 of file CAENMultiplatform.h.

Here is the caller graph for this function:

◆ c_ntoh64()

static uint64_t c_ntoh64 ( uint64_t  x)
inlinestatic

Definition at line 377 of file CAENMultiplatform.h.

Here is the caller graph for this function: