Mail Archives: djgpp-workers/2002/12/01/15:13:08
Hello.
Here's revision 2 of the patch for strtold. Changes:
* No renaming.
* Uses the automatic stub generation to generate a stub for strtold.
* Merged docs for _strtold/strtold into the docs for strtold/_strtold.
OK to commit?
_atold uses _strtold. I left that file alone, rather than switching
it over to using strtold and <libc/stubs.h>.
Thanks, bye, Rich =]
Index: include/stdlib.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stdlib.h,v
retrieving revision 1.14
diff -p -c -3 -r1.14 stdlib.h
*** include/stdlib.h 30 Nov 2002 09:50:29 -0000 1.14
--- include/stdlib.h 1 Dec 2002 20:08:58 -0000
*************** void * realloc(void *_ptr, size_t _size)
*** 73,78 ****
--- 73,79 ----
void srand(unsigned _seed);
double strtod(const char *_s, char **_endptr);
long strtol(const char *_s, char **_endptr, int _base);
+ long double strtold(const char *_s, char **_endptr);
unsigned long strtoul(const char *_s, char **_endptr, int _base);
int system(const char *_s);
size_t wcstombs(char *_s, const wchar_t *_wcs, size_t _n);
Index: include/libc/stubs.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/libc/stubs.h,v
retrieving revision 1.13
diff -p -c -3 -r1.13 stubs.h
*** include/libc/stubs.h 16 Oct 2002 17:33:30 -0000 1.13
--- include/libc/stubs.h 1 Dec 2002 20:08:58 -0000
*************** extern "C" {
*** 69,74 ****
--- 69,75 ----
#define statfs __statfs
#define stricmp __stricmp
#define strnicmp __strnicmp
+ #define strtold _strtold
#define sync __sync
#define tell __tell
#define tzsetwall __tzsetwall
Index: src/libc/ansi/stdlib/strtold.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdlib/strtold.c,v
retrieving revision 1.3
diff -p -c -3 -r1.3 strtold.c
*** src/libc/ansi/stdlib/strtold.c 4 Aug 1999 19:58:22 -0000 1.3
--- src/libc/ansi/stdlib/strtold.c 1 Dec 2002 20:09:01 -0000
***************
*** 1,5 ****
--- 1,7 ----
+ /* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
+ #include <libc/stubs.h>
#include <stdlib.h>
#include <ctype.h>
#include <libc/unconst.h>
*************** static long double powten[] =
*** 11,17 ****
};
long double
! _strtold(const char *s, char **sret)
{
long double r; /* result */
int e, ne; /* exponent */
--- 13,19 ----
};
long double
! strtold(const char *s, char **sret)
{
long double r; /* result */
int e, ne; /* exponent */
Index: src/libc/ansi/stdlib/strtold.txh
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdlib/strtold.txh,v
retrieving revision 1.2
diff -p -c -3 -r1.2 strtold.txh
*** src/libc/ansi/stdlib/strtold.txh 27 Sep 1998 15:20:54 -0000 1.2
--- src/libc/ansi/stdlib/strtold.txh 1 Dec 2002 20:09:01 -0000
*************** This function converts as many character
*** 13,18 ****
--- 13,21 ----
floating point number into one, and sets @var{*endp} to point to the
first unused character.
+ There is also a standardised version of this function:
+ @code{strtold} (@pxref{strtold}).
+
@subheading Return Value
The value the string represented.
*************** char *bp;
*** 29,31 ****
--- 32,64 ----
long double x = _strtold(buf, &bp);
@end example
+ @node strtold, string
+ @subheading Syntax
+
+ @example
+ #include <stdlib.h>
+
+ long double strtold(const char *s, char **endp);
+ @end example
+
+ @subheading Description
+
+ This function converts as many characters of @var{s} that look like a
+ floating point number into one, and sets @var{*endp} to point to the
+ first unused character.
+
+ @subheading Return Value
+
+ The value the string represented.
+
+ @subheading Portability
+
+ @portability !ansi-c89, ansi-c99, !posix-1003.2-1992, posix-1003.1-2001
+
+ @subheading Example
+
+ @example
+ char *buf = "123ret";
+ char *bp;
+ long double x = strtold(buf, &bp);
+ @end example
Index: src/docs/kb/wc204.txi
===================================================================
RCS file: /cvs/djgpp/djgpp/src/docs/kb/wc204.txi,v
retrieving revision 1.123
diff -p -c -3 -r1.123 wc204.txi
*** src/docs/kb/wc204.txi 30 Nov 2002 09:49:47 -0000 1.123
--- src/docs/kb/wc204.txi 1 Dec 2002 20:09:09 -0000
*************** The function @code{_Exit} was added.
*** 788,790 ****
--- 788,793 ----
@findex atoll
The function @code{atoll} was added.
+
+ @findex strtold
+ The function @code{strtold} was added.
- Raw text -