Mail Archives: djgpp-workers/2002/11/02/01:12:30
Below are atoll.c and atoll.txh, which together implement the missing
atoll() function. I copied the existing atol.c and atol.txh and made
hopefully the correct changes. Please let me know if I have made any
mistakes as I don't know if I got the compatability right.
The files are all from the src\libc\ansi\stdlib directory.
==================== START atoll.c ====================
/* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
long long
atoll(const char *str)
{
return strtoll(str, 0, 10);
}
==================== END atoll.c ====================
==================== START atoll.txh ====================
@node atoll, string
@subheading Syntax
@example
#include <stdlib.h>
long long atoll(const char *string);
@end example
@subheading Description
Convert as much of the string as possible to an equivalent long long integer
value.
This function is almost like @code{strtoll(string, NULL, 10)}
(@pxref{strtol}).
@subheading Return Value
The equivalent value, or zero if the string does not represent a number.
@subheading Portability
@portability !ansi-c89, ansi-c99
@subheading Example
@example
main(int argc, char **argv)
@{
long long l = atoll(argv[1]);
@dots{}
@end example
==================== END atoll.txh ===================
==================== START src\libc\ansi\stdlib\makefile patch ============
*** makefile.old Sat Nov 2 16:12:56 2002
--- makefile Sat Nov 2 15:40:50 2002
***************
*** 10,15 ****
--- 10,16 ----
SRC += atof.c
SRC += atoi.c
SRC += atol.c
+ SRC += atoll.c
SRC += atold.c
SRC += bsearch.c
SRC += calloc.c
==================== END src\libc\ansi\stdlib\makefile patch ============
- Raw text -