annotate lib/inttostr.h @ 17476:6057744acd2c default tip master

autoupdate
author Karl Berry <karl@freefriends.org>
date Fri, 16 Aug 2013 06:32:22 -0700
parents e542fd46ad6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1 /* inttostr.h -- convert integers to printable strings
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
2
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
3 Copyright (C) 2001-2006, 2009-2013 Free Software Foundation, Inc.
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
4
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7543
diff changeset
5 This program is free software: you can redistribute it and/or modify
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7543
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7543
diff changeset
8 (at your option) any later version.
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
9
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
13 GNU General Public License for more details.
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
14
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7543
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
17
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
18 /* Written by Paul Eggert */
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
19
7162
19c2e5121b2f Add and change modules to make it easier for coreutils to use
Paul Eggert <eggert@cs.ucla.edu>
parents: 6275
diff changeset
20 #include <stdint.h>
6275
fd0ccce602e4 Sync from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6259
diff changeset
21 #include <sys/types.h>
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
22
5691
ec62790f0938 Factor int-properties macros into a single file, except for
Paul Eggert <eggert@cs.ucla.edu>
parents: 5003
diff changeset
23 #include "intprops.h"
4983
1ade121b7fb9 New module inttostr.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
24
10315
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
25 #ifndef __GNUC_PREREQ
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
26 # if defined __GNUC__ && defined __GNUC_MINOR__
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
27 # define __GNUC_PREREQ(maj, min) \
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
28 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
29 # else
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
30 # define __GNUC_PREREQ(maj, min) 0
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
31 # endif
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
32 #endif
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
33
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
34 #if __GNUC_PREREQ (3,4)
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
35 # undef __attribute_warn_unused_result__
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
36 # define __attribute_warn_unused_result__ \
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
37 __attribute__ ((__warn_unused_result__))
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
38 #else
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
39 # define __attribute_warn_unused_result__ /* empty */
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
40 #endif
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
41
13400
4a25c1663687 inttostr: add a new function, inttostr, and tests
Jim Meyering <meyering@redhat.com>
parents: 12559
diff changeset
42 char *imaxtostr (intmax_t, char *) __attribute_warn_unused_result__;
4a25c1663687 inttostr: add a new function, inttostr, and tests
Jim Meyering <meyering@redhat.com>
parents: 12559
diff changeset
43 char *inttostr (int, char *) __attribute_warn_unused_result__;
10315
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
44 char *offtostr (off_t, char *) __attribute_warn_unused_result__;
13400
4a25c1663687 inttostr: add a new function, inttostr, and tests
Jim Meyering <meyering@redhat.com>
parents: 12559
diff changeset
45 char *uinttostr (unsigned int, char *) __attribute_warn_unused_result__;
10315
96771d88f037 ensure that return value of uinttostr et al are not ignored
Jim Meyering <meyering@redhat.com>
parents: 9309
diff changeset
46 char *umaxtostr (uintmax_t, char *) __attribute_warn_unused_result__;