limb 0.2.0

2024-01-09

u32_scan(3)
limb manual
u32_scan(3)

NAME

u32_scan, u32_scan0 - Read an u32 value from a decimal string

u32_xscan, u32_xscan0 - Read an u32 value from an hexadecimal string

u32_oscan, u32_oscan0 - Read an u32 value from an octal string

u32_bscan, u32_bscan0 - Read an u32 value from a binary string

SYNOPSIS

#include <limb/u32.h>
size_t u32_scan(u32 *dst, const char *s)
size_t u32_scan0(u32 *dst, const char *s)

size_t u32_xscan(u32 *dst, const char *s)
size_t u32_xscan0(u32 *dst, const char *s)

size_t u32_oscan(u32 *dst, const char *s)
size_t u32_oscan0(u32 *dst, const char *s)

size_t u32_bscan(u32 *dst, const char *s)
size_t u32_bscan0(u32 *dst, const char *s)

DESCRIPTION

The u32_scan() function will place into dst the number read as a decimal value from the string s, stopping as soon as a character isn't valid.

The u32_scan0() function is similar but expects the string to contain a valid value and nothing else, stopping with a NUL-terminating byte.

The u32_xscan() and u32_xscan0() functions are similar, but expecting an hexadecimal value in s.

The u32_oscan() and u32_oscan0() functions are similar, but expecting an octal value in s.

The u32_bscan() and u32_bscan0() functions are similar, but expecting a binary value in s.

RETURN VALUE

The u32_*scan family of functions return the number of characters read from s (starting at 0 when the first character is invalid).

The u32_*scan0 family of functions return the number of characters read from s or 0 on error.

ERRORS

The u32_*scan0 family of functions may fail and set errno if :

EINVAL

Invalid character in s

ERANGE

The value in s is too large

limb 0.1.0
2023-07-24
u32_scan(3)