;;; compiled by rms@wookumz.gnu.ai.mit.edu on Mon May 31 20:22:33 1993
;;; from file /gd/gnu/emacs/19.0/lisp/tar-mode.el
;;; emacs version 19.10.3.
;;; bytecomp version FSF 2.08
;;; optimization is on.

(defvar tar-anal-blocksize 20 "\
*The blocksize of tar files written by Emacs, or nil, meaning don't care.
The blocksize of a tar file is not really the size of the blocks; rather, it is
the number of blocks written with one system call.  When tarring to a tape, 
this is the size of the *tape* blocks, but when writing to a file, it doesn't
matter much.  The only noticeable difference is that if a tar file does not
have a blocksize of 20, tar will tell you that; all this really controls is
how many null padding bytes go on the end of the tar file.")
(defvar tar-update-datestamp nil "\
*Whether tar-mode should play fast and loose with sub-file datestamps;
if this is true, then editing and saving a tar file entry back into its
tar file will update its datestamp.  If false, the datestamp is unchanged.
You may or may not want this - it is good in that you can tell when a file
in a tar archive has been changed, but it is bad for the same reason that
editing a file in the tar archive at all is bad - the changed version of 
the file never exists on disk.")
(byte-code "! ! ! !  !) " [boundp tar-parse-info nil tar-header-offset tar-superior-buffer tar-superior-descriptor tar-subfile-mode] 2)
(defalias 'tar-setf '(macro . #[(form val) "	!	 \"9 E^ :$ 	\"^ @=8 A@8F^ @=I A@E^ @=Z A@E^ 	\")" [macroexpand form boundp byte-compile-macro-environment mform setq val error "can't setf %s" aref aset 2 car setcar cdr setcdr "don't know how to setf %s"] 5 "\
A mind-numbingly simple implementation of setf."]))
(defalias 'tar-dolist '(macro . #[(control &rest body) "@A@AA@\nDCDC	DEC\"BBE	F+" [control val init var let _dolist_iterator_ while (car _dolist_iterator_) append body setq cdr] 12 "\
syntax: (dolist (var-name list-expr &optional return-value) &body body)"]))
(defalias 'tar-dotimes '(macro . #[(control &rest body) "@A@AA@\nDDDE\nDEC\"BB	F+" [control val n var let _dotimes_end_ 0 while < append body setq 1+] 10 "\
syntax: (dolist (var-name count-expr &optional return-value) &body body)"]))
(byte-code "MMMMMMMMMMMMMMMMMM%\\'\\)\\*\\+\\-\\.\\/\\1\\2\\3\\5\\6\\7\\8" [make-tar-header (macro . #[(name mode uid git size date ck lt ln magic uname gname devmaj devmin) "\n	\n&" [list vector name mode uid git size date ck lt ln magic uname gname devmaj devmin] 16]) tar-header-name (macro . #[(x) "	E" [aref x 0] 3]) tar-header-mode (macro . #[(x) "	E" [aref x 1] 3]) tar-header-uid (macro . #[(x) "	E" [aref x 2] 3]) tar-header-gid (macro . #[(x) "	E" [aref x 3] 3]) tar-header-size (macro . #[(x) "	E" [aref x 4] 3]) tar-header-date (macro . #[(x) "	E" [aref x 5] 3]) tar-header-checksum (macro . #[(x) "	E" [aref x 6] 3]) tar-header-link-type (macro . #[(x) "	E" [aref x 7] 3]) tar-header-link-name (macro . #[(x) "	E" [aref x 8] 3]) tar-header-magic (macro . #[(x) "	E" [aref x 9] 3]) tar-header-uname (macro . #[(x) "	E" [aref x 10] 3]) tar-header-gname (macro . #[(x) "	E" [aref x 11] 3]) tar-header-dmaj (macro . #[(x) "	E" [aref x 12] 3]) tar-header-dmin (macro . #[(x) "	E" [aref x 13] 3]) make-tar-desc (macro . #[(data-start tokens) "	\nE" [cons data-start tokens] 3]) tar-desc-data-start (macro . #[(x) "	D" [car x] 2]) tar-desc-tokens (macro . #[(x) "	D" [cdr x] 2]) 0 tar-name-offset 100 tar-mode-offset 8 tar-uid-offset tar-gid-offset tar-size-offset 12 tar-time-offset tar-chk-offset tar-linkp-offset 1 tar-link-offset tar-magic-offset tar-uname-offset 32 tar-gname-offset tar-dmaj-offset tar-dmin-offset tar-end-offset] 3)
(defalias 'tokenize-tar-header-block #[(string) "GW	 HU HU.SS	S\nSHSO\"H \"#c !S^#v !S^# \n!S^\n	# !S^OU U? Z \" !S#!\"S#\"#S##$S#$%S#%S#O\nO	O&S#&'S#&.	" [string 512 nil 0 101 tar-mode-offset name-end tar-magic-offset link-end tar-gname-offset uname-end tar-dmaj-offset gname-end tar-linkp-offset link-p tar-uname-offset magic-str string= "ustar  " "GNUtar " uname-valid-p name "[^ ]* " nulsexp string-match tar-name-offset match-end tar-link-offset 48 "/$" 5 vector tar-parse-octal-integer tar-uid-offset tar-gid-offset tar-size-offset tar-time-offset tar-chk-offset tar-dmin-offset tar-end-offset empty-tar-block] 19 "\
Returns a 'tar-header' structure (a list of name, mode, uid, gid, size, 
write-date, checksum, link-type, and link-name)."])
(defalias 'tar-parse-octal-integer #[(string &optional start end) " \n GHU \nW= HW+ 5 \"HZ\\T )" [start 0 end string n 48 * 8] 4 "\
deletes all your files, and then reboots."])
(fset (quote tar-parse-octal-integer-safe) #[(string) "GU !	W4 HW) HV- !T +!" [string L 0 error "empty string" i _dotimes_end_ 48 55 "'%c' is not an octal digit." tar-parse-octal-integer] 3])
(defalias 'checksum-tar-header-block #[(string) "\\	W\" H\\T W< H\\T& !\\," [tar-chk-offset chk-field-start 8 chk-field-end 0 sum i string 512 * 256] 4 "\
Computes and returns a tar-acceptable checksum for this block."])
(defalias 'check-tar-header-block-checksum #[(hblock desired-checksum file-name) "\n!U?  \"" [desired-checksum checksum-tar-header-block hblock beep message "Invalid checksum for file %s!" file-name] 3 "\
Beep and print a warning if the checksum doesn't match."])
(defalias 'recompute-tar-header-block-checksum #[(hblock) "	!\n\"G	I	IW? 	ZZZHIT  -	" [checksum-tar-header-block hblock chk format "%6o" chk-string l 154 0 155 32 i _dotimes_end_ 153 1] 6 "\
Modifies the given string to have a valid checksum field."])
(defalias 'tar-grind-file-mode #[(mode string start) "	\"U Ƃ I	\\\"U# Ƃ$ I	\\\"U7 Ƃ8 I	\\\"UK ƂL I	\\\"U_ Ƃ` I	\\\"Us Ƃt I	\\\"U Ƃ I	\\\"U Ƃ I	\\\"U Ƃ I\"U 	\\I\"U 	\\I" [string start logand mode 256 0 45 114 1 128 119 2 64 120 3 32 4 16 5 8 6 7 1024 115 2048] 5 "\
Write a \"-rw--r--r-\" representing MODE into STRING beginning at START."])
(defalias 'summarize-tar-header-block #[(tar-hblock &optional mod-p) "HHHHHHHHHHH\\S\\\\\\Gp G\\q \\\\\"!H\"!# 䂉 I!\"= \"= \"= \"= \"= \"= \"= \"= \"= \"= \"=\"=I!#GU$!&GU7!9!SG^6767Wq!6ZG6ZZHI6T6O*!TISG^6767W!\\6\\6HI6T6*G^6767W!6ZG6ZZHI6T6*G6767W!6\\6HI6T6*==r6767WC!G6\\\\\\U456HI6T6*G6767Wq!G6\\\\\\6HI6T6N*!." [tar-hblock 0 1 2 3 10 11 4 5 6 7 8 link-name link-p ck time size gname uname gid uid mode name left namew groupw sizew datew slash lastdigit namestart make-string 32 string type mod-p 42 nil 45 108 115 99 98 100 112 20 29 77 35 83 38 86 tar-grind-file-mode int-to-string i _dotimes_end_ 47 "==>" "-->"] 13 "\
Returns a line similar to the output of 'tar -vtf'."])
(defalias 'tar-summarize-buffer #[nil "! Z]\"]= \\\"!\\\"\"= N !H=[ \\HWq H#BBH V ۉS\"\"\\\\)) !!-eb!\"\" \"@##A!!!\"A\") )!`''\"!*!" [message "parsing tar file..." nil result 1 pos buffer-size 1024 bs / 100 bs100 tokens empty-tar-block buffer-substring 512 hblock tokenize-tar-header-block "parsing tar file...%s%%" error "premature EOF parsing tar file." 7 20 4 size 0 "%s has size %s - corrupted." ash -9 9 make-local-variable tar-parse-info nreverse buffer-read-only _dolist_iterator_ tar-desc insert-string summarize-tar-header-block "\n" tar-header-offset narrow-to-region set-buffer-modified-p "parsing tar file...done."] 6 "\
Parse the contents of the tar file in the current buffer, and place a
dired-like listing on the front; then narrow to it, so that only that listing
is visible (and the real data of the buffer is hidden)."])
(defvar tar-mode-map nil "\
*Local keymap for tar-mode listings.")
(byte-code "  !#########################" [tar-mode-map make-keymap suppress-keymap define-key " " tar-next-line "c" tar-copy "d" tar-flag-deleted "" "e" tar-extract "f" "g" revert-buffer "h" describe-mode "n" "" "o" tar-extract-other-window "" "p" tar-previous-line "" "r" tar-rename-entry "u" tar-unflag "v" tar-view "x" tar-expunge "" tar-unflag-backwards "E" "M" tar-chmod-entry "G" tar-chgrp-entry "O" tar-chown-entry put tar-mode mode-class special tar-subfile-mode] 4)
(defalias 'tar-mode #[nil "!!!!\n!! !8 	8 	\";  !" [make-local-variable tar-header-offset tar-parse-info require-final-newline nil revert-buffer-function tar-mode-revert tar-mode major-mode "Tar" mode-name use-local-map tar-mode-map auto-save-mode 0 widen boundp narrow-to-region 1 tar-summarize-buffer run-hooks tar-mode-hook] 3 "\
Major mode for viewing a tar file as a dired-like listing of its contents.
You can move around using the usual cursor motion commands. 
Letters no longer insert themselves.
Type 'e' to pull a file out of the tar file and into its own buffer.
Type 'c' to copy an entry from the tar file into another file on disk.

If you edit a sub-file of this archive (as with the 'e' command) and 
save it with Control-X Control-S, the contents of that buffer will be 
saved back into the tar-file buffer; in this way you can edit a file 
inside of a tar archive without extracting it and re-archiving it.

See also: variables tar-update-datestamp and tar-anal-blocksize.
\\{tar-mode-map}"])
(defalias 'tar-subfile-mode #[(p) "!\n 	 !\" C\"!\n, ?2 \n!VW  F !!)\"!!\"" [boundp tar-superior-buffer error "This buffer is not an element of a tar file." assq tar-subfile-mode minor-mode-alist append (tar-subfile-mode " TarFile") make-local-variable p prefix-numeric-value 0 current-local-map m use-local-map copy-keymap local-set-key "" tar-subfile-save-buffer auto-save-mode nil buffer-auto-save-file-name run-hooks tar-subfile-mode-hook save-buffer] 4 "\
Minor mode for editing an element of a tar-file.
This mode redefines ^X^S to save the current buffer back into its 
associated tar-file buffer.  You must save that buffer to actually
save your changes to disk." "P"])
(defalias 'tar-mode-revert #[(&optional no-autosave no-confirm) "\" ) " [nil tar-header-offset revert-buffer-function revert-buffer t no-confirm widen tar-mode] 3 "\
Revert this buffer and turn on tar mode again, to re-compute the
directory listing."])
(byte-code "MM" [tar-next-line #[(p) "	!m? !" [forward-line p forward-char 36] 2 nil "p"] tar-previous-line #[(p) "	[!" [tar-next-line p] 2 nil "p"]] 2)
(defalias 'tar-current-descriptor #[(&optional noerror) "e!`)\"8 ? !" [count-lines forward-line 0 tar-parse-info noerror error "This line does not describe a tar-file entry."] 4 "\
Returns the tar-descriptor of the current line, or signals an error."])
(defalias 'tar-extract #[(&optional other-window-p) "= AHH	H@\\\\	\\i =: ӂg =E Ղg =P ׂg =[ قg =f ۂg \"	Ut !p! !&%& \n'%!)+) %!)+ )q#b! !%!!!56!'&!)q)\n)!+)!)!)!." [other-window-p view view-p tar-current-descriptor descriptor tokens 0 name 4 size 7 link-p tar-header-offset -1 start end error "This is a %s, not a real file." 5 "directory" 20 "tar directory header" 29 "multivolume-continuation" 35 "sparse entry" 38 "volume header" "link" "This is a zero-length file." tar-buffer concat file-name-nondirectory " (" " in " buffer-file-name ")" bufname buffer-read-only read-only-p get-buffer buffer nil just-created get-buffer-create t ((narrow-to-region 1 tar-header-offset)) widen insert-buffer-substring set-visited-file-name normal-mode rename-buffer make-local-variable tar-superior-buffer tar-superior-descriptor tar-subfile-mode 1 set-buffer-modified-p view-buffer kill-buffer switch-to-buffer-other-window switch-to-buffer] 8 "\
*In tar-mode, extract this entry of the tar file into its own buffer." nil])
(defalias 'tar-extract-other-window #[nil "!" [tar-extract t] 2 "\
*In tar-mode, extract this entry of the tar file into its own buffer." nil])
(defalias 'tar-view #[nil "!" [tar-extract view] 2 "\
*In tar-mode, view the tar file entry on this line." nil])
(defalias 'tar-read-file-name #[(&optional prompt) "  AH!!$!		!\"+ 	!G 	\"> 	!SO@ 	!Q		*" [prompt "Copy to: " expand-file-name tar-current-descriptor 0 default-file read-file-name file-name-directory nil target string= file-name-nondirectory "" file-directory-p string-match "/$" match-end "/"] 6 "\
Calls read-file-name, with the default being the file of the current
tar-file descriptor."])
(defalias 'tar-copy #[(&optional to-file) " AH\nH\nH	@	\\\\\\, !U7 !pӎ! q#!!#q." [tar-current-descriptor descriptor tokens 0 name 4 size 7 link-p tar-header-offset -1 start end error "This is a link, not a real file." "This is a zero-length file." tar-buffer nil buffer ((byte-code "\n\" !" [narrow-to-region 1 tar-header-offset buffer kill-buffer] 3)) generate-new-buffer "*tar-copy-tmp*" widen insert-buffer-substring set-buffer-modified-p write-file to-file message "Copied tar entry %s to %s"] 5 "\
*In tar-mode, extract this entry of the tar file into a file on disk.
If TO-FILE is not supplied, it is prompted for, defaulting to the name of
the current tar-entry." (list (tar-read-file-name))])
(defalias 'tar-flag-deleted #[(p &optional unflag) "!\nW \n[ \nWE !0 !- ɂ. c\nW; ˂< !T *m?N !" [forward-line 0 p i _dotimes_end_ tar-current-descriptor unflag delete-char 1 " " "D" -1 forward-char 36] 4 "\
*In tar mode, mark this sub-file to be deleted from the tar file.
With a prefix argument, mark that many files." "p"])
(defalias 'tar-unflag #[(p) "	\"" [tar-flag-deleted p t] 3 "\
*In tar mode, un-mark this sub-file if it is marked to be deleted.
With a prefix argument, un-mark that many files forward." "p"])
(defalias 'tar-unflag-backwards #[(p) "	[\"" [tar-flag-deleted p t] 3 "\
*In tar mode, un-mark this sub-file if it is marked to be deleted.
With a prefix argument, un-mark that many files backward." "p"])
(defalias 'tar-expunge-internal #[nil " A	@\nH\nH\nH		@\n	>A	* !`  `Z`\"Z*	\" \n\\\\؉\\\"\"\\\\\"Z @  @Z\"A) .\"" [tar-current-descriptor descriptor tokens line 0 name 4 size 7 link-p start tar-parse-info following-descs forward-line line-start end-of-line forward-char line-len delete-region tar-header-offset delq widen -513 data-start ash 511 -9 9 512 data-end data-length _dolist_iterator_ desc setcar narrow-to-region 1] 6 "\
Expunge the tar-entry specified by the current line."])
(defalias 'tar-expunge #[(&optional noconfirm) "\n !E bm* !#  T !  \")U@ !D \")" [noconfirm y-or-n-p "expunge files marked for deletion? " 0 n looking-at "D" tar-expunge-internal forward-line 1 tar-pad-to-blocksize narrow-to-region tar-header-offset message "nothing to expunge." "%s expunged.  Be sure to save this buffer."] 3 "\
*In tar-mode, delete all the archived files flagged for deletion.
This does not modify the disk image; you must save the tar file itself
for this to be permanent." nil])
(defalias 'tar-clear-modification-flags #[nil "b`	W ! !c! )" [0 tar-header-offset looking-at "*" delete-char 1 " " forward-line] 2 "\
remove the stars at the beginning of each line."])
(defalias 'tar-chown-entry #[(new-uid) ";  AIP\" AI\"OP\"" [new-uid tar-current-descriptor 10 tar-alter-one-field tar-uname-offset " " 2 tar-uid-offset format "%6o" 0 6 "  "] 5 "\
*Change the user-id associated with this entry in the tar file.
If this tar file was written by GNU tar, then you will be able to edit
the user id as a string; otherwise, you must edit it as a number.
You can force editing as a number by calling this with a prefix arg.
This does not modify the disk image; you must save the tar file itself
for this to be permanent." (list (let ((tokens (tar-desc-tokens (tar-current-descriptor)))) (if (or current-prefix-arg (not (tar-header-magic tokens))) (let (n) (while (not (numberp (setq n (read-minibuffer "New UID number: " (format "%s" (tar-header-uid tokens))))))) n) (read-string "New UID string: " (tar-header-uname tokens)))))])
(defalias 'tar-chgrp-entry #[(new-gid) ";  AIP\" AI\"OP\"" [new-gid tar-current-descriptor 11 tar-alter-one-field tar-gname-offset " " 3 tar-gid-offset format "%6o" 0 6 "  "] 5 "\
*Change the group-id associated with this entry in the tar file.
If this tar file was written by GNU tar, then you will be able to edit
the group id as a string; otherwise, you must edit it as a number.
You can force editing as a number by calling this with a prefix arg.
This does not modify the disk image; you must save the tar file itself
for this to be permanent." (list (let ((tokens (tar-desc-tokens (tar-current-descriptor)))) (if (or current-prefix-arg (not (tar-header-magic tokens))) (let (n) (while (not (numberp (setq n (read-minibuffer "New GID number: " (format "%s" (tar-header-gid tokens))))))) n) (read-string "New GID string: " (tar-header-gname tokens)))))])
(defalias 'tar-rename-entry #[(new-name) "	\" !	GV ! A	I	\"PO\"" [string= new-name "" error "zero length name." 98 "name too long." tar-current-descriptor 0 tar-alter-one-field make-string 99] 6 "\
*Change the name associated with this entry in the tar file.
This does not modify the disk image; you must save the tar file itself
for this to be permanent." (list (read-string "New name: " (tar-header-name (tar-desc-tokens (tar-current-descriptor)))))])
(defalias 'tar-chmod-entry #[(new-mode) " A\nI\n\"OP\"" [tar-current-descriptor 1 new-mode tar-alter-one-field tar-mode-offset format "%6o" 0 6 "  "] 5 "\
*Change the protection bits associated with this entry in the tar file.
This does not modify the disk image; you must save the tar file itself
for this to be permanent." (list (tar-parse-octal-integer-safe (read-string "New protection (octal): ")))])
(byte-code "MM" [tar-alter-one-field #[(data-position new-data-string) " AÎ!`!`\"\n!ccd) 	@\\\\\\b``G\\\"c\\\"!\\b``\\\"\"ccc\nI\\\"\nH#." [tar-current-descriptor descriptor tokens ((narrow-to-region 1 tar-header-offset)) forward-line 0 p 1 delete-region summarize-tar-header-block "\n" tar-header-offset widen -513 start data-position new-data-string checksum-tar-header-block buffer-substring 512 chk tar-chk-offset 8 format "%6o" 32 6 check-tar-header-block-checksum] 6] tar-octal-time #[(timeval) "@A@\n\"\n\"\"	\"V\"	\"$c*" [timeval lobits hibits format "%05o%01o%05o" lsh -2 logior logand 3 1 32768 0 32767] 8]] 2)
(defalias 'tar-subfile-save-buffer #[nil "!\n 	 !!  !p 		qA\n@\nH\nHЉ\\\"\">A` !َ \\\\Љ\\\"\"\\\"b	!Љ\\\"\"!\\b!Z\"c\nI!Z#$$ $@%%@#\\\"$A$) *Z()\\b``\\\"\"cc.(/\\b``\\\" !cc(\"!4(5\\b``\\\"4\"ccc\n4I*GGZ9b9!!` \"?@!@`\"A B \nC \"D \"E ?!.F  .	G C !	qG H !I J K 	!\"," [boundp tar-superior-buffer error "this buffer has no superior tar file buffer." tar-superior-descriptor "this buffer doesn't have an index into its superior tar file!" buffer-size descriptor subfile-size subfile tokens start 0 name 4 size ash 511 -9 9 size-pad tar-parse-info head following-descs "Can't find this tar file entry in its parent tar file!" ((narrow-to-region 1 tar-header-offset)) widen tar-header-offset -1 data-start data-end delete-region insert-buffer subfile-size-pad make-string difference _dolist_iterator_ desc setcar 512 header-start tar-size-offset 12 format "%11o" 32 tar-update-datestamp tar-time-offset tar-octal-time current-time checksum-tar-header-block buffer-substring chk tar-chk-offset 8 "%6o" 6 position 1 next-line forward-line set-marker make-marker m p insert-before-markers summarize-tar-header-block t "\n" marker-position tar-pad-to-blocksize set-buffer-modified-p nil message "saved into tar-buffer \"%s\" - remember to save that buffer!" buffer-name] 6 "\
In tar subfile mode, write this buffer back into its parent tar-file buffer.
This doesn't write anything to disk - you must save the parent tar-file buffer
to make your changes permanent." nil])
(defalias 'tar-pad-to-blocksize #[nil "??  \nGS\n8@AH\" Ȃ% H\n\n\\\"S\"\"\\K \\b TY \\Vq g \\ T\" x \\ TZ\"c.	" [tar-anal-blocksize widen tar-parse-info last-desc start tokens 7 link-p 0 4 size data-end ash 9 bbytes * / pad-to nil buffer-read-only tar-header-offset buffer-size delete-region make-string] 7 "\
If we are being anal about tar file blocksizes, fix up the current buffer.
Leaves the region wide."])
(defalias 'maybe-write-tar-file #[nil "=& !& & Ď   T	%*ˇ" [major-mode tar-mode boundp tar-header-offset ((narrow-to-region 1 tar-header-offset)) tar-clear-modification-flags widen write-region buffer-size buffer-file-name nil t] 6 "\
Used as a write-file-hook to write tar-files out correctly."])
(byte-code "	>\n 	B!" [maybe-write-tar-file write-file-hooks provide tar-mode] 2)
