[444] | 1 | /* |
---|
| 2 | FUNCTION |
---|
| 3 | <<atoufix16>>, <<atoufix32>>, <<atoufix64>>---string to unsigned fixed-point |
---|
| 4 | |
---|
| 5 | INDEX |
---|
| 6 | atoufix16 |
---|
| 7 | INDEX |
---|
| 8 | atoufix32 |
---|
| 9 | INDEX |
---|
| 10 | atoufix64 |
---|
| 11 | INDEX |
---|
| 12 | _atoufix16_r |
---|
| 13 | INDEX |
---|
| 14 | _atoufix32_r |
---|
| 15 | INDEX |
---|
| 16 | _atoufix64_r |
---|
| 17 | |
---|
| 18 | SYNOPSIS |
---|
| 19 | #include <stdlib.h> |
---|
| 20 | __uint16_t atoufix16(const char *<[s]>); |
---|
| 21 | __uint32_t atoufix32(const char *<[s]>); |
---|
| 22 | __uint64_t atoufix32(const char *<[s]>); |
---|
| 23 | |
---|
| 24 | __uint16_t _atoufix16_r(struct __reent *, const char *<[s]>); |
---|
| 25 | __uint32_t _atoufix32_r(struct __reent *, const char *<[s]>); |
---|
| 26 | __uint64_t _atoufix32_r(struct __reent *, const char *<[s]>); |
---|
| 27 | |
---|
| 28 | DESCRIPTION |
---|
| 29 | <<atoufix16>> converts the initial portion of a string to a |
---|
| 30 | 16-bit fraction unsigned fixed point value. |
---|
| 31 | <<atoufix32>> converts the initial portion of a string to a |
---|
| 32 | 32-bit fraction unsigned fixed point value. |
---|
| 33 | <<atoufix64>> converts the initial portion of a string to a |
---|
| 34 | 64-bit fraction unsigned fixed point value. |
---|
| 35 | <<atoufix16(s)>> is implemented as <<strtoufix16(s, NULL).>> |
---|
| 36 | <<atoufix32(s)>> is implemented as <<strtoufix32(s, NULL).>> |
---|
| 37 | <<atoufix64(s)>> is implemented as <<strtoufix64(s, NULL).>> |
---|
| 38 | |
---|
| 39 | The alternate functions <<_atoufix16_r>>, <<_atoufix32_r>>, |
---|
| 40 | and <<_atoufix64_r>> are reentrant versions. |
---|
| 41 | The extra argument <[reent]> is a pointer to a reentrancy structure. |
---|
| 42 | |
---|
| 43 | RETURNS |
---|
| 44 | The functions return the converted value, if any. If no conversion was |
---|
| 45 | made, <<0>> is returned. If saturation occurs, <<ERANGE>> is stored |
---|
| 46 | in errno. |
---|
| 47 | |
---|
| 48 | PORTABILITY |
---|
| 49 | <<atoufix16>>, <<atoufix32>>, and <<atoufix64>> are non-standard. |
---|
| 50 | |
---|
| 51 | No supporting OS subroutines are directly required. The |
---|
| 52 | OS subroutines required by <<strtod>> are used. |
---|
| 53 | */ |
---|
| 54 | |
---|
| 55 | /* |
---|
| 56 | * Jeff Johnston - 02/13/2002 |
---|
| 57 | */ |
---|
| 58 | |
---|
| 59 | #ifdef __SPE__ |
---|
| 60 | |
---|
| 61 | #include <stdlib.h> |
---|
| 62 | #include <_ansi.h> |
---|
| 63 | |
---|
| 64 | __uint16_t |
---|
| 65 | _atoufix16_r (struct _reent *reent, |
---|
| 66 | const char *s) |
---|
| 67 | { |
---|
| 68 | return _strtoufix16_r (reent, s, NULL); |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | #ifndef _REENT_ONLY |
---|
| 72 | __uint16_t |
---|
| 73 | atoufix16 (const char *s) |
---|
| 74 | { |
---|
| 75 | return strtoufix16 (s, NULL); |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | #endif /* !_REENT_ONLY */ |
---|
| 79 | |
---|
| 80 | #endif /* __SPE__ */ |
---|