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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [language/] [c/] [libc/] [stdlib/] [current/] [include/] [atox.inl] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_LIBC_STDLIB_ATOX_INL
2
#define CYGONCE_LIBC_STDLIB_ATOX_INL
3
/*===========================================================================
4
//
5
//      atox.inl
6
//
7
//      Inline implementations for the ISO standard utility functions
8
//      atoi(), atol() and atof() defined in section 7.10 of the standard
9
//
10
//===========================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under
17
// the terms of the GNU General Public License as published by the Free
18
// Software Foundation; either version 2 or (at your option) any later
19
// version.
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
29
//
30
// As a special exception, if other files instantiate templates or use
31
// macros or inline functions from this file, or you compile this file
32
// and link it with other works to produce a work based on this file,
33
// this file does not by itself cause the resulting work to be covered by
34
// the GNU General Public License. However the source code for this file
35
// must still be made available in accordance with section (3) of the GNU
36
// General Public License v2.
37
//
38
// This exception does not invalidate any other reasons why a work based
39
// on this file might be covered by the GNU General Public License.
40
// -------------------------------------------
41
// ####ECOSGPLCOPYRIGHTEND####
42
//===========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):    jlarmour
46
// Contributors:
47
// Date:         2000-04-28
48
// Purpose:
49
// Description:
50
// Usage:        Do not include this file directly - include  instead
51
//
52
//####DESCRIPTIONEND####
53
//
54
//=========================================================================*/
55
 
56
/* CONFIGURATION */
57
 
58
#include     /* Configuration header */
59
 
60
/* INCLUDES */
61
 
62
#include                  /* NULL */
63
#include      /* Tracing support */
64
 
65
/* FUNCTION PROTOTYPES */
66
 
67
#ifdef __cplusplus
68
extern "C" {
69
#endif
70
 
71
#ifdef CYGFUN_LIBC_strtod
72
extern double
73
atof( const char * /* double_str */ );
74
#endif
75
 
76
extern int
77
atoi( const char * /* int_str */ );
78
 
79
extern long
80
atol( const char * /* long_str */ );
81
 
82
extern long long
83
atoll( const char * /* long_long_str */ );
84
 
85
#ifdef CYGFUN_LIBC_strtod
86
extern double
87
strtod( const char * /* double_str */, char ** /* endptr */ );
88
#endif
89
 
90
extern long
91
strtol( const char * /* long_str */, char ** /* endptr */,
92
        int /* base */ );
93
 
94
extern unsigned long
95
strtoul( const char * /* ulong_str */, char ** /* endptr */,
96
         int /* base */ );
97
 
98
#ifdef CYGFUN_LIBC_STDLIB_CONV_LONGLONG
99
extern long long
100
strtoll( const char * /* long_long_str */, char ** /* endptr */,
101
        int /* base */ );
102
 
103
extern unsigned long long
104
strtoull( const char * /* ulong_long_str */, char ** /* endptr */,
105
         int /* base */ );
106
#endif
107
 
108
#ifdef __cplusplus
109
} /* extern "C" */
110
#endif
111
 
112
/* INLINE FUNCTIONS */
113
 
114
/* 7.10.1 String conversion functions */
115
 
116
#ifndef CYGPRI_LIBC_STDLIB_ATOX_INLINE
117
# define CYGPRI_LIBC_STDLIB_ATOX_INLINE extern __inline__
118
#endif
119
 
120
 
121
#ifdef CYGFUN_LIBC_strtod
122
CYGPRI_LIBC_STDLIB_ATOX_INLINE double
123
atof( const char *__nptr )
124
{
125
    double __retval;
126
 
127
    CYG_REPORT_FUNCNAMETYPE( "atof", "returning %f" );
128
 
129
    CYG_CHECK_DATA_PTR( __nptr, "__nptr is an invalid pointer!" );
130
 
131
    __retval = strtod( __nptr, (char **)NULL );
132
 
133
    CYG_REPORT_RETVAL( __retval );
134
 
135
    return __retval;
136
} /* atof() */
137
#endif
138
 
139
CYGPRI_LIBC_STDLIB_ATOX_INLINE int
140
atoi( const char *__nptr )
141
{
142
    int __retval;
143
 
144
    CYG_REPORT_FUNCNAMETYPE( "atoi", "returning %d" );
145
 
146
    CYG_CHECK_DATA_PTR( __nptr, "__nptr is an invalid pointer!" );
147
 
148
    __retval = (int)strtol( __nptr, (char **)NULL, 10 );
149
 
150
    CYG_REPORT_RETVAL( __retval );
151
 
152
    return __retval;
153
} /* atoi() */
154
 
155
 
156
CYGPRI_LIBC_STDLIB_ATOX_INLINE long
157
atol( const char *__nptr )
158
{
159
    long __retval;
160
 
161
    CYG_REPORT_FUNCNAMETYPE( "atol", "returning %ld" );
162
 
163
    CYG_CHECK_DATA_PTR( __nptr, "__nptr is an invalid pointer!" );
164
 
165
    __retval = strtol( __nptr, (char **)NULL, 10 );
166
 
167
    CYG_REPORT_RETVAL( __retval );
168
 
169
    return __retval;
170
} /* atol() */
171
 
172
#ifdef CYGFUN_LIBC_STDLIB_CONV_LONGLONG
173
CYGPRI_LIBC_STDLIB_ATOX_INLINE long long
174
atoll( const char *__nptr )
175
{
176
    long long __retval;
177
 
178
    CYG_REPORT_FUNCNAMETYPE( "atoll", "returning %lld" );
179
 
180
    CYG_CHECK_DATA_PTR( __nptr, "__nptr is an invalid pointer!" );
181
 
182
    __retval = strtoll( __nptr, (char **)NULL, 10 );
183
 
184
    CYG_REPORT_RETVAL( __retval );
185
 
186
    return __retval;
187
} /* atoll() */
188
#endif
189
 
190
#endif /* CYGONCE_LIBC_STDLIB_ATOX_INL multiple inclusion protection */
191
 
192
/* EOF atox.inl */

powered by: WebSVN 2.1.0

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