diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2009-05-20 00:32:10 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2009-05-20 00:32:10 +0200 |
commit | 50b3ff7b91e78a61aca93247bee586d6d7eb27c8 (patch) | |
tree | db4c7eee24479ac7ee6888ce1562facf60159b71 /gl/c-strtod.h | |
parent | 2701ccd500e60537a8c2977a81549ff33eeaef3f (diff) | |
download | monitoring-plugins-50b3ff7b91e78a61aca93247bee586d6d7eb27c8.tar.gz |
Sync with the latest Gnulib code (cb75dc5)
Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
Diffstat (limited to 'gl/c-strtod.h')
-rw-r--r-- | gl/c-strtod.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/gl/c-strtod.h b/gl/c-strtod.h index ca9a9e7c..2b3f8473 100644 --- a/gl/c-strtod.h +++ b/gl/c-strtod.h | |||
@@ -1,2 +1,37 @@ | |||
1 | double c_strtod (char const *, char **); | 1 | /* Convert string to double, using the C locale. |
2 | long double c_strtold (char const *, char **); | 2 | |
3 | Copyright (C) 2003-2004, 2009 Free Software Foundation, Inc. | ||
4 | |||
5 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 3 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
17 | |||
18 | /* Parse the initial portion of the string pointed to by NPTR as a floating- | ||
19 | point number (in decimal or hexadecimal notation), like in the C locale: | ||
20 | accepting only the ASCII digits '0'..'9', and only '.' as decimal point | ||
21 | character. | ||
22 | If ENDPTR is not NULL, set *ENDPTR to point to the first byte beyond the | ||
23 | parsed number or to NPTR if the string does not start with a parseable | ||
24 | number. | ||
25 | Return value: | ||
26 | - If successful, return the value as a double or 'long double', | ||
27 | respectively, and don't modify errno. | ||
28 | - In case of overflow, return ±HUGE_VAL or ±HUGE_VALL, respectively, and | ||
29 | set errno to ERANGE. | ||
30 | - In case of underflow, return a value very near to 0 and set errno to | ||
31 | ERANGE. | ||
32 | - If the string does not start with a number at all, return 0 (and recall | ||
33 | that if ENDPTR != NULL, *ENDPTR is set to NPTR), and maybe set errno to | ||
34 | EINVAL. | ||
35 | - In case of other error, return 0 and set errno, for example to ENOMEM. */ | ||
36 | extern double c_strtod (char const *nptr, char **endptr); | ||
37 | extern long double c_strtold (char const *nptr, char **endptr); | ||