API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also

The std_scanul() converts an ASCII representation of a number to an unsigned long. It expects strings that match the following pattern:
         spaces [+|-] digits

'Spaces' is zero or more ASCII space or tab characters.
'Digits' is any number of digits valid in the radix. Letters 'A' through 'Z' are treated as digits with values 10 through 35. 'Digits' may begin with "0x" when a radix of 0 or 16 is specified.
Upper and lower case letters can be used interchangeably.

the start of the string to scan.
the numeric radix (or base) of the number. Valid values are 2 through 36 or zero, which implies auto-detection. Auto-detection examines the digits field. If it begins with "0x", radix 16 is selected. Otherwise, if it begins with "0" radix 8 is selected. Otherwise, radix 10 is selected.
if ppchEnd is not NULL, *ppchEnd points to the first character that did not match the expected pattern shown above, except on STD_BADPARAM and STD_OVERFLOW when it is set to the start of the string.
If pnError is not NULL, *pnError holds the error code, which is one of the
  •     uint32 std_scanul( const char *pchBuf, int nRadix, const char **ppchEnd,
                           int *pnError)

  • The converted numeric result.
The std_scanul() is similar to ANSI C's strtoul() but differs in the following respects: 1. It returns an error/success code. strtoul() results are ambiguous unless the caller sets errno to zero before calling it. 2. std_scanul() is free of references to current locale and errno. Some strtoul() implementations use locale; some don't. 3. It provides more complete reporting of range underflow. strtoul() does not distinguish between "-1" and "0xFFFFFFFF", and underflow is poorly defined. 4. std_scanul() reports a "no digits" error code to distinguish "0" from whitespace, "+", etc..