OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [powerpc/] [atosfix16.c] - Blame information for rev 826

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/*
2
FUNCTION
3
   <<atosfix16>>, <<atosfix32>>, <<atosfix64>>---string to signed fixed-point
4
 
5
INDEX
6
        atosfix16
7
INDEX
8
        atosfix32
9
INDEX
10
        atosfix64
11
INDEX
12
        _atosfix16_r
13
INDEX
14
        _atosfix32_r
15
INDEX
16
        _atosfix64_r
17
 
18
ANSI_SYNOPSIS
19
        #include <stdlib.h>
20
        __int16_t atosfix16(const char *<[s]>);
21
        __int32_t atosfix32(const char *<[s]>);
22
        __int64_t atosfix32(const char *<[s]>);
23
 
24
        __int16_t _atosfix16_r(struct __reent *, const char *<[s]>);
25
        __int32_t _atosfix32_r(struct __reent *, const char *<[s]>);
26
        __int64_t _atosfix32_r(struct __reent *, const char *<[s]>);
27
 
28
TRAD_SYNOPSIS
29
        #include <stdlib.h>
30
        __int16_t atosfix16(<[s]>)
31
        const char *<[s]>;
32
 
33
        __int32_t atosfix32(<[s]>)
34
        const char *<[s]>;
35
 
36
        __int64_t atosfix64(<[s]>)
37
        const char *<[s]>;
38
 
39
        __int16_t _atosfix16_r(<reent>, <[s]>)
40
        struct _reent *<[reent]>;
41
        const char *<[s]>;
42
 
43
        __int32_t _atosfix32_r(<reent>, <[s]>)
44
        struct _reent *<[reent]>;
45
        const char *<[s]>;
46
 
47
        __int64_t _atosfix64_r(<reent>, <[s]>)
48
        struct _reent *<[reent]>;
49
        const char *<[s]>;
50
 
51
DESCRIPTION
52
        <<atosfix16>> converts the initial portion of a string to a sign
53
        + 15-bit fraction fixed point value.
54
        <<atosfix32>> converts the initial portion of a string to a sign
55
        + 31-bit fraction fixed point value.
56
        <<atosfix64>> converts the initial portion of a string to a sign
57
        + 63-bit fraction fixed point value.
58
        <<atosfix16(s)>> is implemented as <<strtosfix16(s, NULL).>>
59
        <<atosfix32(s)>> is implemented as <<strtosfix32(s, NULL).>>
60
        <<atosfix64(s)>> is implemented as <<strtosfix64(s, NULL).>>
61
 
62
        The alternate functions <<_atosfix16_r>>, <<_atosfix32_r>>,
63
        and <<_atosfix64_r>> are reentrant versions.
64
        The extra argument <[reent]> is a pointer to a reentrancy structure.
65
 
66
RETURNS
67
        The functions return the converted value, if any. If no conversion was
68
        made, <<0>> is returned.  If saturation occurs, <<ERANGE>> is stored
69
        in errno.
70
 
71
PORTABILITY
72
        <<atosfix16>>, <<atosfix32>>, and <<atosfix64>> are non-standard.
73
 
74
        No supporting OS subroutines are directly required.  The
75
        OS subroutines required by <<strtod>> are used.
76
*/
77
 
78
/*
79
 * Jeff Johnston - 02/13/2002
80
 */
81
 
82
#ifdef __SPE__
83
 
84
#include <stdlib.h>
85
#include <_ansi.h>
86
 
87
__int16_t
88
_DEFUN (_atosfix16_r, (reent, s),
89
        struct _reent *reent _AND
90
        _CONST char *s)
91
{
92
  return _strtosfix16_r (reent, s, NULL);
93
}
94
 
95
#ifndef _REENT_ONLY
96
__int16_t
97
_DEFUN (atosfix16, (s),
98
        _CONST char *s)
99
{
100
  return strtosfix16 (s, NULL);
101
}
102
 
103
#endif /* !_REENT_ONLY */
104
 
105
#endif /* __SPE__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.