Back to index

glibc  2.9
strtof_l.c
Go to the documentation of this file.
00001 /* Convert string representing a number to float value, using given locale.
00002    Copyright (C) 1997,98,2002, 2004 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #include <xlocale.h>
00022 
00023 extern float ____strtof_l_internal (const char *, char **, int, __locale_t);
00024 extern unsigned long long int ____strtoull_l_internal (const char *, char **,
00025                                                  int, int, __locale_t);
00026 
00027 #define       FLOAT         float
00028 #define       FLT           FLT
00029 #ifdef USE_WIDE_CHAR
00030 # define STRTOF             wcstof_l
00031 # define __STRTOF    __wcstof_l
00032 #else
00033 # define STRTOF             strtof_l
00034 # define __STRTOF    __strtof_l
00035 #endif
00036 #define       MPN2FLOAT     __mpn_construct_float
00037 #define       FLOAT_HUGE_VAL       HUGE_VALF
00038 #define SET_MANTISSA(flt, mant) \
00039   do { union ieee754_float u;                                               \
00040        u.f = (flt);                                                  \
00041        if ((mant & 0x7fffff) == 0)                                   \
00042         mant = 0x400000;                                             \
00043        u.ieee.mantissa = (mant) & 0x7fffff;                                 \
00044        (flt) = u.f;                                                  \
00045   } while (0)
00046 
00047 #include "strtod_l.c"