Improve checkpoint interface.

* src/buffer.c (format_total_stats): The format arg is const
All uses updated.
(default_total_format): const
* src/checkpoint.c (tty, tty_cleanup): New static.
(format_checkpoint_string): New "canned" format %c
(checkpoint_finish): New function.
* src/common.h (checkpoint_finish): New proto.
* src/tar.c (main): Call checkpoint_finish.`
This commit is contained in:
Sergey Poznyakoff
2014-01-22 07:28:02 +02:00
parent f0a1f78196
commit 717a07e208
4 changed files with 66 additions and 19 deletions

View File

@@ -514,7 +514,7 @@ print_stats (FILE *fp, const char *text, tarlong numbytes)
from the archive), EOL is a delimiter to add at the end of the output
line. */
int
format_total_stats (FILE *fp, char **formats, int eor, int eol)
format_total_stats (FILE *fp, const char **formats, int eor, int eol)
{
int n;
@@ -569,7 +569,7 @@ format_total_stats (FILE *fp, char **formats, int eor, int eol)
return n;
}
char *default_total_format[] = {
const char *default_total_format[] = {
N_("Total bytes read"),
/* Amanda 2.4.1p1 looks for "Total bytes written: [0-9][0-9]*". */
N_("Total bytes written"),