Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(to_oct): Now static. Value arg is now uintmax_t. Accept new args
giving name of type of octal field, for error messages. Report an
error if the value is too large to fit in the field.
(gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
(write_eot, write_long, finish_header, deal_with_sparse,
finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
appropriate. Remove now-useless casts. Use unsigned long to print
*_t types, except use STRINGIFY_BIGINT for off_t.
(find_new_file_size): 1st arg is now off_t*.
(finish_sparse_file): Args now use off_t, not long.
Check for lseek error.
(create_archive, dump_file): Cast -1 to dev_t when necessary.
(dump_file): Device arg is now dev_t.
Avoid overflow when testing whether file has holes
by using the new ST_NBLOCKSIZE macro.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(record_start_block, save_totsize, save_sizeleft, real_s_totsize,
real_s_sizeleft, current_block_ordinal): Now off_t.
(write_error): Arg is now ssize_t.
(child_pid): Now pid_t.
(available_space_after): Now size_t.
(child_open_for_compress, child_open_for_uncompress, flush_write,
open_archive, flush_write, write_error, flush_read, close_archive):
Use pid_t, ssize_t, size_t when appropriate. Remove now-useless
casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(read_and, list_archive, read_header, decode_mode, print_header,
print_for_mkdir): Use mode_t, off_t, size_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
(read_header): Check for overflow when converting header size.
(from_oct): Now static. Now returns uintmax_t. `where' arg is now
const char *. Size arg is now size_t. Now takes new type and maxval
args. Compute result using uintmax_t, not long. Report error if
field does not contain octal number in range.
(gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
uintmax_from_oct): New functions.
(stringify_uintmax_t_backwards): New function.
(decode_mode, print_for_mkdir): Mode arg is now mode_t.
(skip_file): Offset arg is now off_t.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(newdir_umask, current_umask): Now mode_t.
(extract_sparse_file): Args now use off_t.
(set_mode, set_stat, make_directories, extract_sparse_file,
extract_archive): Use off_t, size_t, ssize_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__): Use
pid_t, size_t, ssize_t when appropriate. Remove now-useless casts.
Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
off_t.
(get_status_string, get_status_off): New function.
(get_status): Now returns long, so that it can store ssize_t.
Invoke get_status_string to do the real work.
(rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
(rmt_lseek__): Now returns off_t, using new get_status_off function.
(rmt_ioctl__): Convert mt_count by hand, since it might be longer than long.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(check_decimal): Now returns 1 if successful, 0 otherwise, and returns
uintmax_t value into new arg. Check for arithmetic overflow.
(decode_options): Avoid overflow if record_size fits in size_t but not int.
Check for overflow on user or group ids.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(append_file) Use off_t, size_t, ssize_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
(update_archive): Cast -1 to dev_t when necessary.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(allocated_size): Now size_t, and now initialized to 0.
(prepare_record_buffer): Arg is now size_t.
Remove now-useless casts.
(main): Use `long' for status, so that it can store ssize_t.
Use daddr_t, mode_t, size_t, off_t when appropriate.
Convert daddr_t and off_t values ourselves, since they might be longer
than long. Convert other types using `long' primitives.
When processing MTIOCTOP, do not try to pass resulting
count back, since it won't work (it could be too large) and it's
not expected anyway.