annotate lib/atoll.c @ 17426:90f3d53e01f5

sig2str: port to C++ * lib/sig2str.h (sig2str, str2sig): Declare as extern "C". Reported by Daniel J Sebald in <http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00000.html>.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 02 Jun 2013 11:52:41 -0700
parents e542fd46ad6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
1 /* Copyright (C) 1991, 1997-1998, 2008-2013 Free Software Foundation, Inc.
10673
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 This file is part of the GNU C Library.
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
12002
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
4 This program is free software: you can redistribute it and/or modify
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
5 it under the terms of the GNU General Public License as published by
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
7 (at your option) any later version.
10673
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
12002
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
9 This program is distributed in the hope that it will be useful,
10673
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
12002
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
12 GNU General Public License for more details.
10673
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
12002
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
14 You should have received a copy of the GNU General Public License
f295924fa612 Use the standard header with GPL copyright.
Bruno Haible <bruno@clisp.org>
parents: 10673
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
10673
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #if !_LIBC
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 # include <config.h>
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #endif
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 /* Specification. */
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <stdlib.h>
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #if _LIBC
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 # undef atoll
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #endif
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 /* Convert a string to a long long int. */
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 long long int
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 atoll (const char *nptr)
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 {
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 return strtoll (nptr, (char **) NULL, 10);
8e54ec4dc691 New module 'atoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 }