limb 0.2.0

2024-01-09

u16_scan(3)
limb manual
u16_scan(3)

NAME

u16_scan, u16_scan0 - Read an u16 value from a decimal string

u16_xscan, u16_xscan0 - Read an u16 value from an hexadecimal string

u16_oscan, u16_oscan0 - Read an u16 value from an octal string

u16_bscan, u16_bscan0 - Read an u16 value from a binary string

SYNOPSIS

#include <limb/u16.h>
size_t u16_scan(u16 *dst, const char *s)
size_t u16_scan0(u16 *dst, const char *s)

size_t u16_xscan(u16 *dst, const char *s)
size_t u16_xscan0(u16 *dst, const char *s)

size_t u16_oscan(u16 *dst, const char *s)
size_t u16_oscan0(u16 *dst, const char *s)

size_t u16_bscan(u16 *dst, const char *s)
size_t u16_bscan0(u16 *dst, const char *s)

DESCRIPTION

The u16_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 u16_scan0() function is similar but expects the string to contain a valid value and nothing else, stopping with a NUL-terminating byte.

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

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

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

RETURN VALUE

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

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

ERRORS

The u16_*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
u16_scan(3)