Lines Matching refs:tar_hdl

285 static void compress_stream(struct archive_handler *tar_hdl)  in compress_stream()  argument
300 dup2(tar_hdl->src_fd, 1); //write to tar fd in compress_stream()
304 dup2(pipefd[1], tar_hdl->src_fd); //write to pipe in compress_stream()
482 struct archive_handler *tar_hdl = xzalloc(sizeof(struct archive_handler)); in init_handler() local
483 tar_hdl->extract_handler = extract_to_disk; in init_handler()
484 return tar_hdl; in init_handler()
500 static void extract_stream(struct archive_handler *tar_hdl) in extract_stream() argument
513 dup2(tar_hdl->src_fd, 0); in extract_stream()
518 dup2(pipefd[0], tar_hdl->src_fd); //read from pipe in extract_stream()
568 static void unpack_tar(struct archive_handler *tar_hdl) in unpack_tar() argument
579 if (tar_hdl->offset % 512) { in unpack_tar()
580 sz = 512 - tar_hdl->offset % 512; in unpack_tar()
581 tar_skip(tar_hdl, sz); in unpack_tar()
583 i = readall(tar_hdl->src_fd, &tar, 512); in unpack_tar()
584 tar_hdl->offset += i; in unpack_tar()
600 && !lseek(tar_hdl->src_fd, -i, SEEK_CUR)) { in unpack_tar()
601 tar_hdl->offset -= i; in unpack_tar()
602 extract_stream(tar_hdl); in unpack_tar()
615 file_hdr = &tar_hdl->file_hdr; in unpack_tar()
671 xread(tar_hdl->src_fd, longlink, file_hdr->size); in unpack_tar()
672 tar_hdl->offset += file_hdr->size; in unpack_tar()
677 xread(tar_hdl->src_fd, longname, file_hdr->size); in unpack_tar()
678 tar_hdl->offset += file_hdr->size; in unpack_tar()
686 tar_skip(tar_hdl, file_hdr->size); in unpack_tar()
690 longname = process_extended_hdr(tar_hdl, file_hdr->size); in unpack_tar()
735 tar_skip(tar_hdl, file_hdr->size); in unpack_tar()
738 tar_hdl->extract_handler(tar_hdl); in unpack_tar()
749 struct archive_handler *tar_hdl; in tar_main() local
771 tar_hdl = init_handler(); in tar_main()
772 tar_hdl->src_fd = fd; in tar_main()
775 if (toys.optflags & FLAG_O) tar_hdl->extract_handler = extract_to_stdout; in tar_main()
778 tar_hdl->extract_handler = extract_to_command; in tar_main()
780 if (toys.optflags & FLAG_z) extract_stream(tar_hdl); in tar_main()
781 unpack_tar(tar_hdl); in tar_main()
787 if (toys.optflags & FLAG_z) compress_stream(tar_hdl); in tar_main()
789 TT.handle = tar_hdl; in tar_main()
795 writeall(tar_hdl->src_fd, toybuf, 1024); in tar_main()
800 close(tar_hdl->src_fd); in tar_main()
801 free(tar_hdl); in tar_main()