;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'cpio-newc) #@29 The length of a crc header. (defconst *cpio-crc-header-length* 110 (#$ . 108)) #@49 RE to match the magic number of a newc archive. (defconst *cpio-crc-magic-re* "070702" (#$ . 193)) (byte-code "\301\302\207" [*cpio-crc-magic-re* "070702" nil] 1) (defconst *cpio-crc-ino-re* *cpio-newc-ino-re*) (defconst *cpio-crc-mode-re* *cpio-newc-mode-re*) (defconst *cpio-crc-uid-re* *cpio-newc-uid-re*) (defconst *cpio-crc-gid-re* *cpio-newc-gid-re*) (defconst *cpio-crc-nlink-re* *cpio-newc-nlink-re*) (defconst *cpio-crc-mtime-re* *cpio-newc-mtime-re*) (defconst *cpio-crc-filesize-re* *cpio-newc-filesize-re*) (defconst *cpio-crc-dev-maj-re* *cpio-newc-dev-maj-re*) (defconst *cpio-crc-dev-min-re* *cpio-newc-dev-min-re*) (defconst *cpio-crc-rdev-maj-re* *cpio-newc-rdev-maj-re*) (defconst *cpio-crc-rdev-min-re* *cpio-newc-rdev-min-re*) (defconst *cpio-crc-rdev-min-re* *cpio-newc-rdev-min-re*) (defconst *cpio-crc-namesize-re* *cpio-newc-namesize-re*) (defconst *cpio-crc-chksum-re* *cpio-newc-chksum-re*) (defconst *cpio-crc-filename-re* *cpio-newc-filename-re*) #@46 RE to match crc header format cpio archives. (defconst *cpio-crc-header-re* nil (#$ . 1175)) (byte-code "\306\307 \307\n\307 \307\f\307 \307\n\307 \307\f\307 \307\307\307\307\307\310\260\311\207" [*cpio-crc-magic-re* *cpio-crc-ino-re* *cpio-crc-mode-re* *cpio-crc-uid-re* *cpio-crc-gid-re* *cpio-crc-nlink-re* "\\(" "\\)\\(" "\\)" nil *cpio-crc-mtime-re* *cpio-crc-filesize-re* *cpio-crc-dev-maj-re* *cpio-crc-dev-min-re* *cpio-crc-rdev-maj-re* *cpio-crc-rdev-min-re* *cpio-crc-namesize-re* *cpio-crc-chksum-re* *cpio-crc-filename-re* *cpio-crc-header-re*] 31) (defconst *cpio-crc-magic-re-idx* *cpio-newc-magic-re-idx*) (defconst *cpio-crc-ino-re-idx* *cpio-newc-ino-re-idx*) (defconst *cpio-crc-mode-re-idx* *cpio-newc-mode-re-idx*) (defconst *cpio-crc-uid-re-idx* *cpio-newc-uid-re-idx*) (defconst *cpio-crc-gid-re-idx* *cpio-newc-gid-re-idx*) (defconst *cpio-crc-nlink-re-idx* *cpio-newc-nlink-re-idx*) (defconst *cpio-crc-mtime-re-idx* *cpio-newc-mtime-re-idx*) (defconst *cpio-crc-filesize-re-idx* *cpio-newc-filesize-re-idx*) (defconst *cpio-crc-dev-maj-re-idx* *cpio-newc-dev-maj-re-idx*) (defconst *cpio-crc-dev-min-re-idx* *cpio-newc-dev-min-re-idx*) (defconst *cpio-crc-rdev-maj-re-idx* *cpio-newc-rdev-maj-re-idx*) (defconst *cpio-crc-rdev-min-re-idx* *cpio-newc-rdev-min-re-idx*) (defconst *cpio-crc-namesize-re-idx* *cpio-newc-namesize-re-idx*) (defconst *cpio-crc-chksum-re-idx* *cpio-newc-chksum-re-idx*) (defconst *cpio-crc-filename-re-idx* *cpio-newc-filename-re-idx*) (defconst *cpio-crc-field-width* *cpio-newc-field-width*) (defconst *cpio-crc-padding-modulus* *cpio-newc-padding-modulus*) (defconst *cpio-crc-padding-char* *cpio-newc-padding-char*) (defconst *cpio-crc-padding-str* *cpio-newc-padding-str*) (defconst *cpio-crc-magic-field-offset* *cpio-newc-magic-field-offset*) (defconst *cpio-crc-ino-field-offset* *cpio-newc-ino-field-offset*) (defconst *cpio-crc-mode-field-offset* *cpio-newc-mode-field-offset*) (defconst *cpio-crc-uid-field-offset* *cpio-newc-uid-field-offset*) (defconst *cpio-crc-gid-field-offset* *cpio-newc-gid-field-offset*) (defconst *cpio-crc-nlink-field-offset* *cpio-newc-nlink-field-offset*) (defconst *cpio-crc-mtime-field-offset* *cpio-newc-mtime-field-offset*) (defconst *cpio-crc-filesize-field-offset* *cpio-newc-filesize-field-offset*) (defconst *cpio-crc-dev-maj-field-offset* *cpio-newc-dev-maj-field-offset*) (defconst *cpio-crc-dev-min-field-offset* *cpio-newc-dev-min-field-offset*) (defconst *cpio-crc-rdev-maj-field-offset* *cpio-newc-rdev-maj-field-offset*) (defconst *cpio-crc-rdev-min-field-offset* *cpio-newc-rdev-min-field-offset*) (defconst *cpio-crc-namesize-field-offset* *cpio-newc-namesize-field-offset*) (defconst *cpio-crc-chksum-field-offset* *cpio-newc-chksum-field-offset*) (defconst *cpio-crc-name-field-offset* *cpio-newc-name-field-offset*) #@40 The TRAILER string for a newc archive. (defconst *cpio-crc-trailer* "07070200000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!" (#$ . 4027)) #@82 The default block size for this cpio archive. Taken from cpio-2.12/src/global.c. (custom-declare-variable '*cpio-crc-blocksize* '*cpio-newc-blocksize* '(#$ . 4241) :type 'integer :group 'cpio) #@369 Return the header string at or following point WHERE. If WHERE is not given, then use point. CAVEATS: 1. This searches for the magic number at the begining of the header; if WHERE is inside the magic number, then the search will fail. This works best if you are (looking-at) a header. 2. This returns the pure header; it does not provide the filename itself. (defalias 'cpio-newc-header-at-point #[(&optional where) "\204`\306\307\310 \311\216\312\f!\203\313\314!\2026 Gu\210\315 e\316#\203/\312\f!\211\203 \2056\313\314!,\207" [where found fname save-match-data-internal *cpio-newc-header-re* *cpio-newc-magic-re* "cpio-newc-header-at-point" nil match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] looking-at match-string-no-properties 0 re-search-backward t] 4 (#$ . 4441)]) (byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\306\"\210\300\307\310\"\210\300\311\312\"\210\300\313\314\"\210\300\315\316\"\210\300\317\320\"\210\300\321\322\"\210\300\323\324\"\210\300\325\326\"\210\300\327\330\"\210\300\331\332\"\210\300\333\334\"\210\300\335\336\"\210\300\337\340\"\210\300\335\336\"\210\300\341\342\"\207" [defalias cpio-crc-header-size cpio-newc-header-size cpio-crc-parse-magic cpio-newc-parse-magic cpio-crc-parse-ino cpio-newc-parse-ino cpio-crc-parse-mode cpio-newc-parse-mode cpio-crc-parse-uid cpio-newc-parse-uid cpio-crc-parse-gid cpio-newc-parse-gid cpio-crc-parse-nlink cpio-newc-parse-nlink cpio-crc-parse-mtime cpio-newc-parse-mtime cpio-crc-parse-filesize cpio-newc-parse-filesize cpio-crc-parse-dev-maj cpio-newc-parse-dev-maj cpio-crc-parse-dev-min cpio-newc-parse-dev-min cpio-crc-parse-rdev-maj cpio-newc-parse-rdev-maj cpio-crc-parse-rdev-min cpio-newc-parse-rdev-min cpio-crc-parse-namesize cpio-newc-parse-namesize cpio-crc-parse-chksum cpio-newc-parse-chksum cpio-crc-parse-name cpio-newc-parse-name cpio-crc-parse-contents cpio-newc-parse-contents] 3) #@259 Return the internal entry header structure encoded in HEADER-STR. The optional argument WHERE should be a buffer location at the beginning of a known cpio newc header. If WHERE is not given, then take point and hope. This function does NOT get the contents. (defalias 'cpio-crc-parse-header #[(header-string) "\306\307\211\211\310 \311\216\312 \"\210\313\314!\315!\316!\317!\320!\321!\322!\211\323!\324!\325!\326!\327!\211\330!\331\n\"&*\332!\205\\,\207" [result filesize namesize fname save-match-data-internal *cpio-newc-header-re* "cpio-newc-parse-header" nil match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] string-match vector cpio-newc-parse-ino cpio-newc-parse-mode cpio-newc-parse-uid cpio-newc-parse-gid cpio-newc-parse-nlink cpio-newc-parse-mtime cpio-newc-parse-filesize cpio-newc-parse-dev-maj cpio-newc-parse-dev-min cpio-newc-parse-rdev-maj cpio-newc-parse-rdev-min cpio-newc-parse-namesize cpio-newc-parse-chksum cpio-newc-parse-name cpio-entry-name header-string] 17 (#$ . 6394)]) #@101 Make a header string for a CRC archive based on ATTRS. This function does NOT include the contents. (defalias 'cpio-crc-make-header-string #[(attrs &optional contents) "\306\307!\310\311!\312!\313!\314!\315!\316!\317!\320!\321!\322!\323!\324!\325\326\nGT\"\325\326\327!\203>\330\202I\331\f\203G\f\202H\n!\"\n\332\260\333 \334 G \"\332#! \310\335\"\336#)\266\203\203o \202t\337\340 #+\207" [attrs header-string name fname contents *cpio-crc-padding-modulus* "cpio-crc-make-header-string" cpio-entry-name nil cpio-crc-make-magic cpio-crc-make-ino cpio-crc-make-mode cpio-crc-make-uid cpio-crc-make-gid cpio-crc-make-nlink cpio-crc-make-mtime cpio-crc-make-filesize cpio-crc-make-dev-maj cpio-crc-make-dev-min cpio-crc-make-rdev-maj cpio-crc-make-rdev-min format "%08X" cpio-special-file 0 cpio-crc-make-chksum "" cg-pad-right cg-round-up t string-match error "%s(): I built a bad header: [[%s]]" *cpio-crc-header-re* inhibit-changing-match-data] 17 (#$ . 7481)]) #@44 Return the magic string for a CRC archive. (defalias 'cpio-crc-make-magic #[(attrs) "\207" [*cpio-crc-magic-re*] 1 (#$ . 8481)]) (byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\306\"\210\300\307\310\"\210\300\311\312\"\210\300\313\314\"\210\300\315\316\"\210\300\317\320\"\210\300\321\322\"\210\300\323\324\"\210\300\325\326\"\207" [defalias cpio-crc-make-ino cpio-newc-make-ino cpio-crc-make-mode cpio-newc-make-mode cpio-crc-make-uid cpio-newc-make-uid cpio-crc-make-gid cpio-newc-make-gid cpio-crc-make-nlink cpio-newc-make-nlink cpio-crc-make-mtime cpio-newc-make-mtime cpio-crc-make-filesize cpio-newc-make-filesize cpio-crc-make-dev-maj cpio-newc-make-dev-maj cpio-crc-make-dev-min cpio-newc-make-dev-min cpio-crc-make-rdev-maj cpio-newc-make-rdev-maj cpio-crc-make-rdev-min cpio-newc-make-rdev-min] 3) #@79 Return a string value for the newc cpio entry from the file attributes ATTRS. (defalias 'cpio-crc-make-chksum #[(entry-name-or-contents) "\304\305\306!\203\307!\202\310\311 \"\210\n+\207" [entry-name-or-contents contents result fname "cpio-crc-make-chksum" 0 cpio-entry-exists-p cpio-contents mapc #[(c) " \\\211\207" [result c] 2]] 4 (#$ . 9306)]) #@100 Parse the crc cpio header that begins at point. If there is no header there, then signal an error. (defalias 'cpio-crc-parse-header-at-point #[nil "\303 \304\305!)\262\204\306\307\"\210\310\311\312!!)\207" [fname *cpio-crc-header-re* inhibit-changing-match-data "cpio-crc-parse-header-at-point" t looking-at error "%s(): point is not looking at a crc header." cpio-crc-parse-header match-string-no-properties 0] 3 (#$ . 9674)]) #@378 Move the point to the beginning of the next crc cpio header. If point is looking-at such a header, then that is the next one and there is no movement. (Thus, a caller may have to make sure that point has moved.) This returns the a marker for point where the header is found, if one is found. It returns NIL otherwise. This sets match-data for the entire header and each field. (defalias 'cpio-crc-goto-next-header #[nil "\304\305\211\306 d\307#\203\310\224b\311\310!\312 B\202\305+\207" [header-string header-start fname *cpio-crc-header-re* "cpio-crc-goto-next-header" nil re-search-forward t 0 match-string-no-properties point-marker] 4 (#$ . 10116)]) #@209 Build an internal structure reflecting the contents of the crc cpio archive in the current buffer. See the variable *cpio-catalog* for more information. CAVEAT: This respects neither narrowing nor the point. (defalias 'cpio-crc-build-catalog #[nil "\306\307\211\211\211\310\307\211\211\211\211~\210eb\210\311 \211\203}@\211\203}A\211\203} \203}\312 \211\203 \313 !Gu\210`\314S\"Tb\210\315 \316 \"\210\317 !\320  \321$BB \f\\S\211b\210\202 \322\323\"\210\237. \207" [catalog those-contents contents-end contents-start filesize parsed-header "cpio-crc-build-catalog" nil t cpio-crc-goto-next-header cpio-crc-parse-header-at-point cpio-entry-size cg-round-up point-marker set-marker-insertion-type cpio-entry-name vector cpio-mode-entry-unmodified mapc #[(ce) "\301A!\207" [ce cpio-validate-catalog-entry] 2] header-info that-header-string header-end header-start fname *cpio-crc-padding-modulus* *cg-insert-after*] 12 (#$ . 10787)]) (byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias cpio-crc-start-of-trailer cpio-newc-start-of-trailer cpio-crc-end-of-archive cpio-newc-end-of-archive] 3) #@63 Replace thed current trailer in the current cpio crc archive. (defalias 'cpio-crc-adjust-trailer #[nil "\301\302 \210\303 )\207" [fname "cpio-crc-adjust-trailer" cpio-crc-delete-trailer cpio-crc-insert-trailer] 1 (#$ . 11943)]) #@43 Insert a crc trailer into a cpio archive. (defalias 'cpio-crc-insert-trailer #[nil "\306 \211G\307  \307\nc\210db\210\310`S\f\"\211`ZT\311\f\312\"c\210 \211-\207" [fname *cpio-crc-trailer* base-trailer base-len len buffer-read-only "cpio-crc-insert-trailer" nil cg-round-up make-string 0 bro-before *cpio-crc-blocksize*] 4 (#$ . 12178)]) (defalias 'cpio-crc-delete-trailer 'cpio-newc-delete-trailer) #@35 Return the checksum for FILENAME. (defalias 'cpio-crc-make-chksum-for-file #[(filename) "\303\304\305\306\"r q\210\307\216\310\n!\210\311\312ed\"!,\207" [fname #1=#:temp-buffer filename "cpio-newc-make-chksum-for-file" generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents cpio-crc-make-chksum buffer-substring-no-properties] 4 (#$ . 12595)]) (provide 'cpio-crc)