diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-06-22 06:14:28 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-06-22 06:14:28 +0000 |
commit | 53fa1be9b65f01469eafcc7c57499d73e35715a7 (patch) | |
tree | 52bc4fdd56c82dcd254136e04f4cb09402f978bd /paxlib | |
parent | 49113b5fbf40e65bb5b154ce2a11b9ec0b19be35 (diff) | |
download | paxutils-53fa1be9b65f01469eafcc7c57499d73e35715a7.tar.gz |
Improve support for time stamps and other wide integers.
* gnulib.modules: Add inttostr, quote, quotearg.
* lib/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
(INT_STRLEN_BOUND): Remove.
Include "intprops.h" instead.
(UINTMAX_STRSIZE_BOUND): Define in terms of INT_BUFSIZE_BOUND,
not INT_STRLEN_BOUND.
[HAVE_UTIME_H]: Don't include utime.h.
* paxlib/DISTFILES: Remove convert.c.
* paxlib/convert.c: Remove.
* paxlib/error.c: Include quote.h, quotearg.h.
* paxlib/paxlib.h: Include inttostr.h.
(STRINGIFY_BIGINT): Define in terms of umaxtostr.
(stringify_uintmax_t_backwards): Remove decl.
* tests/genfile.c: Include <utimens.h> instead of rolling our own.
(exec_checkpoint): Use utimens instead of rolling our own.
Don't pass extra args to error.
(main): Wrap message inside _().
Diffstat (limited to 'paxlib')
-rw-r--r-- | paxlib/DISTFILES | 1 | ||||
-rw-r--r-- | paxlib/convert.c | 33 | ||||
-rw-r--r-- | paxlib/error.c | 4 | ||||
-rw-r--r-- | paxlib/paxlib.h | 5 |
4 files changed, 4 insertions, 39 deletions
diff --git a/paxlib/DISTFILES b/paxlib/DISTFILES index 1fbdab0..bb4c9e9 100644 --- a/paxlib/DISTFILES +++ b/paxlib/DISTFILES @@ -1,4 +1,3 @@ -convert.c error.c exit.c names.c diff --git a/paxlib/convert.c b/paxlib/convert.c deleted file mode 100644 index 6734c71..0000000 --- a/paxlib/convert.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Data conversion functions for GNU paxutils - - Copyright (C) 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include <system.h> - -/* Format O as a null-terminated decimal string into BUF _backwards_; - return pointer to start of result. */ -char * -stringify_uintmax_t_backwards (uintmax_t o, char *buf) -{ - *--buf = '\0'; - do - *--buf = '0' + (int) (o % 10); - while ((o /= 10) != 0); - return buf; -} - diff --git a/paxlib/error.c b/paxlib/error.c index b609b27..b2bf3d6 100644 --- a/paxlib/error.c +++ b/paxlib/error.c @@ -18,6 +18,8 @@ #include <system.h> #include <paxlib.h> +#include <quote.h> +#include <quotearg.h> /* Decode MODE from its binary form in a stat structure, and encode it into a 9-byte string STRING, terminated with a NUL. */ @@ -355,5 +357,3 @@ chdir_fatal (char const *name) { call_arg_fatal ("chdir", name); } - - diff --git a/paxlib/paxlib.h b/paxlib/paxlib.h index 03f15eb..c9b3036 100644 --- a/paxlib/paxlib.h +++ b/paxlib/paxlib.h @@ -22,6 +22,7 @@ #define _paxlib_h_ #include <hash.h> +#include <inttostr.h> /* Error reporting functions and definitions */ @@ -100,9 +101,7 @@ void write_error (char const *); void pax_exit (void); void fatal_exit (void) __attribute__ ((noreturn)); -#define STRINGIFY_BIGINT(i, b) \ - stringify_uintmax_t_backwards ((uintmax_t) (i), (b) + UINTMAX_STRSIZE_BOUND) -char *stringify_uintmax_t_backwards (uintmax_t, char *); +#define STRINGIFY_BIGINT(i, b) umaxtostr (i, b) /* Name-related functions */ |