Files
glibc/stdlib/strtod.c
T

71 lines
1.8 KiB
C
Raw Normal View History

1995-02-18 01:27:10 +00:00
/* Read decimal floating point numbers.
1997-02-10 03:19:57 +00:00
This file is part of the GNU C Library.
2004-03-14 21:12:06 +00:00
Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
1999-04-28 23:13:52 +00:00
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
1995-02-18 01:27:10 +00:00
1997-02-10 03:19:57 +00:00
The GNU C Library is free software; you can redistribute it and/or
2001-07-06 04:58:11 +00:00
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
1995-02-18 01:27:10 +00:00
1997-02-10 03:19:57 +00:00
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2001-07-06 04:58:11 +00:00
Lesser General Public License for more details.
1995-02-18 01:27:10 +00:00
2001-07-06 04:58:11 +00:00
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
1995-02-18 01:27:10 +00:00
#include <stdlib.h>
2004-03-14 21:12:06 +00:00
#include <wchar.h>
#include <locale/localeinfo.h>
1995-02-18 01:27:10 +00:00
2004-03-14 21:12:06 +00:00
#ifndef FLOAT
# define FLOAT double
# ifdef USE_WIDE_CHAR
# define STRTOF wcstod
# define STRTOF_L __wcstod_l
# else
# define STRTOF strtod
# define STRTOF_L __strtod_l
# endif
1998-04-07 16:28:09 +00:00
#endif
1997-05-24 02:30:09 +00:00
#ifdef USE_WIDE_CHAR
# include <wctype.h>
# define STRING_TYPE wchar_t
#else
# define STRING_TYPE char
#endif
#define INTERNAL(x) INTERNAL1(x)
#define INTERNAL1(x) __##x##_internal
1995-02-18 01:27:10 +00:00
FLOAT
2004-03-14 21:12:06 +00:00
INTERNAL (STRTOF) (nptr, endptr, group)
const STRING_TYPE *nptr;
STRING_TYPE **endptr;
int group;
1995-02-18 01:27:10 +00:00
{
2004-03-14 21:12:06 +00:00
return INTERNAL(STRTOF_L) (nptr, endptr, group, _NL_CURRENT_LOCALE);
1995-02-18 01:27:10 +00:00
}
2004-03-14 21:12:06 +00:00
#if defined _LIBC
libc_hidden_def (INTERNAL (STRTOF))
#endif
2004-03-14 21:12:06 +00:00
FLOAT
1996-07-08 10:21:07 +00:00
#ifdef weak_function
weak_function
#endif
2004-03-14 21:12:06 +00:00
STRTOF (nptr, endptr)
const STRING_TYPE *nptr;
STRING_TYPE **endptr;
{
2004-03-14 21:12:06 +00:00
return INTERNAL(STRTOF_L) (nptr, endptr, 0, _NL_CURRENT_LOCALE);
}