NAME
u16.h - 16bit unsigned integers
SYNOPSIS
#include <limb/u16.h>
DESCRIPTION
This header defines functions allowing to work with 16bit unsigned integers.
Constants
The following constants are defined :
U16_FMT
Maximum length for a byte array that can hold an u16 value in decimal representation, plus a NUL-terminating byte
U16_FMTG
Same as U16_FMT but with thousand-separators
U16_BFMT
Same as U16_FMT but for binary
U16_OFMT
Same as U16_FMT but for octal
U16_XFMT
Same as U16_FMT but for hexadecimal
Functions
The following functions/macros are defined :
Convert a u16 number to big endian.
Convert a u16 number to little endian.
Similar to u16_be(3) but takes a pointer.
Similar to u16_le(3) but takes a pointer.
Similar to u16p_be(3) but for an array of pointers.
Similar to u16p_le(3) but for an array of pointers.
Store a u16 number encoded in little endian.
Read a u16 number encoded in little endian.
Store a u16 number encoded in big endian.
Read a u16 number encoded in big endian.
Write a u16 number as decimal into a byte array.
Write a u16 number as decimal, using coma as thousand separator, into a byte array.
Similar to u16_fmt(3) but as binary.
Similar to u16_fmt(3) but as octal.
Similar to u16_fmt(3) but as hexadecimal.
Similar to u16_fmt(3) but filling with zeroes if less than given size.
Similar to u16_fmtg(3) but filling with zeroes if less than given size.
Similar to u16_bfmt(3) but filling with zeroes if less than given size.
Similar to u16_ofmt(3) but filling with zeroes if less than given size.
Similar to u16_xfmt(3) but filling with zeroes if less than given size.
Read a u16 value from a byte array.
Similar to u16_scan(3) but for binary value.
Similar to u16_scan(3) but for octal value.
Similar to u16_scan(3) but for hexadecimal value.
Similar to u16_scan(3) but expects a NUL-terminated string.
Similar to u16_bscan(3) but expects a NUL-terminated string.
Similar to u16_oscan(3) but expects a NUL-terminated string.
Similar to u16_xscan(3) but expects a NUL-terminated string.