alsa.audio: limit the supported frequencies to common set
[AROS.git] / compiler / stdc / strtoumax.c
blobff6c0e11fcec1a7017abdce5b9a983169cc9e261
1 /*
2 Copyright © 2008, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function strtoumax().
6 */
8 #include <stdlib.h>
10 /*****************************************************************************
12 NAME */
13 #include <inttypes.h>
15 uintmax_t strtoumax (
17 /* SYNOPSIS */
18 const char * nptr,
19 char ** endptr,
20 int base)
22 /* FUNCTION
23 Convert a string of digits into an integer according to the
24 given base. This function is like strtoul() except the fact,
25 that it returns a value of type uintmax_t.
27 INPUTS
28 str - The string which should be converted.
29 endptr - If this is non-NULL, then the address of the first
30 character after the number in the string is stored
31 here.
32 base - The base for the number.
34 RESULT
35 The value of the string. The first character after the number
36 is returned in *endptr, if endptr is non-NULL. If no digits can
37 be converted, *endptr contains str (if non-NULL) and 0 is
38 returned.
40 NOTES
42 EXAMPLE
44 BUGS
45 errno is not set as required by C99 standard
47 SEE ALSO
48 strtoul(), strtoull()
50 INTERNALS
52 ******************************************************************************/
54 /* TODO: Implement errno handling in strtoumax() */
55 #if defined(AROS_HAVE_LONG_LONG)
56 return (uintmax_t) strtoull(nptr, endptr, base);
57 #else
58 return (uintmax_t) strtoul(nptr, endptr, base);
59 #endif