Welcome to little lamb

Code » limb » master » tree

[master] / src / doc / u32.h / u32.h.0.md

% limb manual
% u32.h(0)
% limb 0.1.0
% 2023-07-24

# NAME

u32.h - 32bit unsigned integers

# SYNOPSIS

    #include <limb/u32.h>

# DESCRIPTION

This header defines functions allowing to work with 32bit unsigned integers.

## Constants

The following constants are defined :

: *U32_FMT*
:: Maximum length for a byte array that can hold an u32 value in decimal
:: representation, plus a NUL-terminating byte

: *U32_FMTG*
:: Same as *U32_FMT* but with thousand-separators

: *U32_BFMT*
:: Same as *U32_FMT* but for binary

: *U32_OFMT*
:: Same as *U32_FMT* but for octal

: *U32_XFMT*
:: Same as *U32_FMT* but for hexadecimal

## Functions

The following functions/macros are defined :

: [u32_be](3)
:: Convert a u32 number to big endian.

: [u32_le](3)
:: Convert a u32 number to little endian.

: [u32p_be](3)
:: Similar to [u32_be](3) but takes a pointer.

: [u32p_le](3)
:: Similar to [u32_le](3) but takes a pointer.

: [u32pa_be](3)
:: Similar to [u32p_be](3) but for an array of pointers.

: [u32pa_le](3)
:: Similar to [u32p_le](3) but for an array of pointers.

: [u32_pack](3)
:: Store a u32 number encoded in little endian.

: [u32_unpack](3)
:: Read a u32 number encoded in little endian.

: [u32_pack_big](3)
:: Store a u32 number encoded in big endian.

: [u32_unpack_big](3)
:: Read a u32 number encoded in big endian.

: [u32_fmt](3)
:: Write a u32 number as decimal into a byte array.

: [u32_fmtg](3)
:: Write a u32 number as decimal, using coma as thousand separator, into a
:: byte array.

: [u32_bfmt](3)
:: Similar to [u32_fmt](3) but as binary.

: [u32_ofmt](3)
:: Similar to [u32_fmt](3) but as octal.

: [u32_xfmt](3)
:: Similar to [u32_fmt](3) but as hexadecimal.

: [u32_0fmt](3)
:: Similar to [u32_fmt](3) but filling with zeroes if less than given size.

: [u32_0fmtg](3)
:: Similar to [u32_fmtg](3) but filling with zeroes if less than given size.

: [u32_0bfmt](3)
:: Similar to [u32_bfmt](3) but filling with zeroes if less than given size.

: [u32_0ofmt](3)
:: Similar to [u32_ofmt](3) but filling with zeroes if less than given size.

: [u32_0xfmt](3)
:: Similar to [u32_xfmt](3) but filling with zeroes if less than given size.

: [u32_scan](3)
:: Read a u32 value from a byte array.

: [u32_bscan](3)
:: Similar to [u32_scan](3) but for binary value.

: [u32_oscan](3)
:: Similar to [u32_scan](3) but for octal value.

: [u32_xscan](3)
:: Similar to [u32_scan](3) but for hexadecimal value.

: [u32_scan0](3)
:: Similar to [u32_scan](3) but expects a NUL-terminated string.

: [u32_bscan0](3)
:: Similar to [u32_bscan](3) but expects a NUL-terminated string.

: [u32_oscan0](3)
:: Similar to [u32_oscan](3) but expects a NUL-terminated string.

: [u32_xscan0](3)
:: Similar to [u32_xscan](3) but expects a NUL-terminated string.