|
Lines 66-71
static void update_progress_meter(int);
Link Here
|
| 66 |
static time_t start; /* start progress */ |
66 |
static time_t start; /* start progress */ |
| 67 |
static time_t last_update; /* last progress update */ |
67 |
static time_t last_update; /* last progress update */ |
| 68 |
static const char *file; /* name of the file being transferred */ |
68 |
static const char *file; /* name of the file being transferred */ |
|
|
69 |
static size_t file_len = 0; /* allocated length of file */ |
| 69 |
static off_t start_pos; /* initial position of transfer */ |
70 |
static off_t start_pos; /* initial position of transfer */ |
| 70 |
static off_t end_pos; /* ending position of transfer */ |
71 |
static off_t end_pos; /* ending position of transfer */ |
| 71 |
static off_t cur_pos; /* transfer position as of last refresh */ |
72 |
static off_t cur_pos; /* transfer position as of last refresh */ |
|
Lines 251-257
void
Link Here
|
| 251 |
start_progress_meter(const char *f, off_t filesize, off_t *ctr) |
252 |
start_progress_meter(const char *f, off_t filesize, off_t *ctr) |
| 252 |
{ |
253 |
{ |
| 253 |
start = last_update = monotime(); |
254 |
start = last_update = monotime(); |
| 254 |
file = f; |
255 |
if (strlen(f) > file_len) { |
|
|
256 |
file_len = strlen(f); |
| 257 |
file = realloc(file, file_len * 4 + 1); |
| 258 |
} |
| 259 |
strnvis(file, f, file_len * 4 + 1, VIS_SAFE|VIS_OCTAL|VIS_NOSLASH); |
| 255 |
start_pos = *ctr; |
260 |
start_pos = *ctr; |
| 256 |
end_pos = filesize; |
261 |
end_pos = filesize; |
| 257 |
cur_pos = 0; |
262 |
cur_pos = 0; |