;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'bindat) #@29 The length of a bin header. (defconst *cpio-bin-header-length* (byte-code "\300\301!G\207" [string-as-unibyte "\307q "] 2) (#$ . 105)) #@48 RE to match the magic number of a bin archive. (defconst *cpio-bin-magic-re* "\307q" (#$ . 269)) (byte-code "\301\302\207" [*cpio-bin-magic-re* "\307q" nil] 1) #@46 RE to match the c_dev field in a bin header. (defconst *cpio-bin-dev-re* "\\w\\w" (#$ . 436)) (byte-code "\301\302\207" [*cpio-bin-dev-re* "\\w\\w" nil] 1) #@46 RE to match the c_ino field in a bin header. (defconst *cpio-bin-ino-re* "\\w\\w" (#$ . 599)) (byte-code "\301\302\207" [*cpio-bin-ino-re* "\\w\\w" nil] 1) #@47 RE to match the c_mode field in a bin header. (defconst *cpio-bin-mode-re* "\\w\\w" (#$ . 762)) (byte-code "\301\302\207" [*cpio-bin-mode-re* "\\w\\w" nil] 1) #@46 RE to match the c_uid field in a bin header. (defconst *cpio-bin-uid-re* "\\w\\w" (#$ . 928)) (byte-code "\301\302\207" [*cpio-bin-uid-re* "\\w\\w" nil] 1) #@46 RE to match the c_gid field in a bin header. (defconst *cpio-bin-gid-re* "\\w\\w" (#$ . 1091)) (byte-code "\301\302\207" [*cpio-bin-gid-re* "\\w\\w" nil] 1) #@48 RE to match the c_nlink field in a bin header. (defconst *cpio-bin-nlink-re* "\\w\\w" (#$ . 1255)) (byte-code "\301\302\207" [*cpio-bin-nlink-re* "\\w\\w" nil] 1) #@47 RE to match the c_rdev field in a bin header. (defconst *cpio-bin-rdev-re* "\\w\\w" (#$ . 1425)) (byte-code "\301\302\207" [*cpio-bin-rdev-re* "\\w\\w" nil] 1) #@48 RE to match the c_mtime field in a bin header. (defconst *cpio-bin-mtime-re* "\\w\\w\\w\\w" (#$ . 1592)) (byte-code "\301\302\207" [*cpio-bin-mtime-re* "\\w\\w\\w\\w" nil] 1) #@47 RE to match the c_rdev field in a bin header. (defconst *cpio-bin-namesize-re* "\\w\\w" (#$ . 1774)) (byte-code "\301\302\207" [*cpio-bin-rdev-re* "\\w\\w" nil] 1) #@51 RE to match the c_filesize field in a bin header. (defconst *cpio-bin-filesize-re* "\\w\\w\\w\\w" (#$ . 1945)) (byte-code "\301\302\207" [*cpio-bin-filesize-re* "\\w\\w\\w\\w" nil] 1) #@41 RE to match a filename in a bin header. (defconst *cpio-bin-filename-re* nil (#$ . 2136)) (byte-code "\301\302\207" [*cpio-bin-filename-re* "[[:print:]]+" nil] 1) #@46 RE to match bin header format cpio archives. (defconst *cpio-bin-header-re* nil (#$ . 2306)) (byte-code "\306\307 \307\n\307 \307\f\307 \307\n\307 \307\f\307 \307\307\310\260\311\207" [*cpio-bin-magic-re* *cpio-bin-dev-re* *cpio-bin-ino-re* *cpio-bin-mode-re* *cpio-bin-uid-re* *cpio-bin-gid-re* "\\(" "\\)\\(" "\\)" nil *cpio-bin-nlink-re* *cpio-bin-rdev-re* *cpio-bin-mtime-re* *cpio-bin-namesize-re* *cpio-bin-filesize-re* *cpio-bin-filename-re* *cpio-bin-header-re*] 25) #@55 The offset of the name field in a cpio binary header. (defvar *cpio-bin-name-field-offset* 26 (#$ . 2800)) (defconst cpio-bin-index-spec '((:dev u16) (:ino u16) (:mode u16) (:uid u16) (:gid u16) (:nlink u16) (:rdev u16) (:mtime u32) (:namesize u16) (:filesize u32) (:filename strz (:namesize)))) (byte-code "\301\302\207" [cpio-bin-index-spec ((:magic u16r) (:dev u16r) (:ino u16r) (:mode u16r) (:uid u16r) (:gid u16r) (:nlink u16r) (:rdev u16r) (:mtime0 u16r) (:mtime1 u16r) (:namesize u16r) (:filesize0 u16r) (:filesize1 u16r) (:filename strz (:namesize))) nil] 1) #@67 The string that identifies an entry as a BIN style cpio(1) entry. (defconst *cpio-bin-magic* *cpio-bin-magic-re* (#$ . 3374)) (byte-code "\302\207" [*cpio-bin-magic-re* *cpio-bin-magic* nil] 1) #@48 An integer value of the cpio bin magic number. (defconst *cpio-bin-magic-int* 29127 (#$ . 3576)) #@68 The modulus to which some things are padded in a BIN cpio archive. (defconst *cpio-bin-padding-modulus* 2 (#$ . 3679)) (byte-code "\301\211\207" [*cpio-bin-padding-modulus* 2] 2) #@86 A character to be used for padding headers and entry contents in a bin cpio archive. (defconst *cpio-bin-padding-char* 0 (#$ . 3865)) (byte-code "\301\211\207" [*cpio-bin-padding-char* 0] 2) #@117 A single character string of the character to be used for padding headers and entry contents in a bin cpio archive. (defconst *cpio-bin-padding-str* "" (#$ . 4064)) (byte-code "\301\302\207" [*cpio-bin-padding-str* "" nil] 1) #@46 The TRAILER string of a cpio binary archive. (defconst *cpio-bin-trailer* (string-as-unibyte "\307q TRAILER!!!") (#$ . 4299)) #@50 The default blocksize for a cpio binary archive. (custom-declare-variable '*cpio-bin-blocksize* 512 '(#$ . 4456) :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-bin-header-at-point #[(&optional where) "\204`\306\307\310 \311\216\312\f!\203\313\314\315!!\202: Gu\210\316 e\317#\2031\312\f!\211\203! \205:\313\314\315!!,\207" [where found fname save-match-data-internal *cpio-bin-header-re* *cpio-bin-magic-re* "cpio-bin-header-at-point" nil match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] looking-at string-as-unibyte match-string-no-properties 0 re-search-backward t] 4 (#$ . 4605)]) #@159 Return the internal entry header structure encoded in HEADER-STRING. HEADER-STRING is a unibyte string. The function does NOT get the contents of that entry. (defalias 'cpio-bin-parse-header #[(header-string) "\306\307\211\211\211\211\310\"\311\f\312\"\311\f\313\"D\314\311\f\315\"_\311\f\316\"\\\311\f\317\"\211\320\230\2038\307\202i\321\311\f\322\"\311\f\323\"\311\f\324\"\311\f\325\"\311\f\326\" \n\311\f\327\"\330\311\f\331\"\330\311\f\332\"\330&\333 !\205i .\207" [entry-name result filesize mtime header-info fname "cpio-bin-parse-header" nil bindat-unpack bindat-get-field :mtime0 :mtime1 65536 :filesize0 :filesize1 :filename "TRAILER!!!" vector :ino :mode :uid :gid :nlink :dev 0 :rdev :namesize cpio-entry-name cpio-bin-index-spec header-string] 15 (#$ . 5475)]) #@72 Determine the length of the header implied by the given HEADER-STRING. (defalias 'cpio-bin-header-size #[(header-string namesize) "\306S\307\310\fT\n\\\211 \"\311U\203 T\312 \"+\207" [namesize total local-namesize fname *cpio-bin-name-field-offset* *cpio-bin-padding-modulus* "cpio-bin-header-size" -1 mod 0 cg-round-up] 3 (#$ . 6275)]) #@108 Make a BIN style padded cpio header for the given ATTRibuteS. This function does NOT include the contents. (defalias 'cpio-bin-make-header-string #[(attrs &optional contents) "\306\307!\310\211\311!\312!%\313&\314\315!B\316\317!B\320\321!B\322\323!B\324\325!B\326\327!B\330\331!B\332\333!B\334\n@B\335\nAB\336 GTB\337 @B\340 AB\341 \342PB\257\"\343\f\344\fG'\"\342#\211.\207" [attrs filesize mtime padding header-string name "cpio-bin-make-header-string" cpio-entry-name nil cpio-bin-make-mtime cpio-bin-make-filesize bindat-pack :magic cpio-bin-make-magic :dev cpio-bin-make-dev-maj :ino cpio-bin-make-ino :mode cpio-bin-make-mode :uid cpio-bin-make-uid :gid cpio-bin-make-gid :nlink cpio-bin-make-nlink :rdev cpio-bin-make-rdev-maj :mtime0 :mtime1 :namesize :filesize0 :filesize1 :filename "" cg-pad-right cg-round-up fname cpio-bin-index-spec *cpio-bin-padding-modulus*] 18 (#$ . 6628)]) #@36 Return the BIN magic header string (defalias 'cpio-bin-make-magic #[(attrs) "\302 )\207" [fname *cpio-bin-magic-int* "cpio-bin-make-magic"] 1 (#$ . 7549)]) #@69 Return a string value for the inode from the file attributes ATTRS. (defalias 'cpio-bin-make-ino #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-ino" cpio-ino] 2 (#$ . 7712)]) #@68 Return a string value for the mode from the file attributes ATTRS. (defalias 'cpio-bin-make-mode #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-mode" cpio-mode-value] 2 (#$ . 7903)]) #@76 Return an integer string value for the UID from the file attributes ATTRS. (defalias 'cpio-bin-make-uid #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-uid" cpio-uid] 2 (#$ . 8102)]) #@76 Return an integer string value for the GID from the file attributes ATTRS. (defalias 'cpio-bin-make-gid #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-gid" cpio-gid] 2 (#$ . 8300)]) #@88 Return an integer string value for the number of links from the file attributes ATTRS. (defalias 'cpio-bin-make-nlink #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-nlink" cpio-nlink] 2 (#$ . 8498)]) #@72 Return a string value for the mod time from the file attributes ATTRS. (defalias 'cpio-bin-make-mtime #[(attrs) "\305\306 !\211@\nA@ \f,B\207" [fname attrs mod-time high-time low-time "cpio-bin-make-mtime" cpio-mtime] 3 (#$ . 8714)]) #@80 Return an 8 digit hex string for the filesize attribute among the given ATTRs. (defalias 'cpio-bin-make-filesize #[(attrs) "\303\304!\305\306\307 \"\310\"\306\311 \"*B\207" [attrs filesize fname "cpio-bin-make-filesize" cpio-entry-size lsh logand 4294901760 8 65535] 4 (#$ . 8958)]) #@76 Return a string value for the major device from the file attributes ATTRS. (defalias 'cpio-bin-make-dev-maj #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-dev-maj" cpio-dev-maj] 2 (#$ . 9250)]) #@76 Return a string value for the minor device from the file attributes ATTRS. (defalias 'cpio-bin-make-dev-min #[(attrs) "\300\207" [0] 1 (#$ . 9460)]) #@74 Return a string value for the major rdev from the file attributes ATTRS. (defalias 'cpio-bin-make-rdev-maj #[(attrs) "\302\303 !)\207" [fname attrs "cpio-bin-make-rdev-maj" cpio-rdev-maj] 2 (#$ . 9615)]) #@74 Return a string value for the minor rdev from the file attributes ATTRS. (defalias 'cpio-bin-make-rdev-min #[(attrs) "\300\207" [0] 1 (#$ . 9826)]) #@78 Return a string value for the bin cpio entry from the file attributes ATTRS. (defalias 'cpio-bin-make-chksum #[(attrs) "\300\207" [0] 1 (#$ . 9980)]) #@100 Parse the bin cpio header that begins at point. If there is no header there, then signal an error. (defalias 'cpio-bin-parse-header-at-point #[nil "\303 \304\305!)\262\204\306\307\"\210\310\311\312\313!!!)\207" [fname *cpio-bin-header-re* inhibit-changing-match-data "cpio-bin-parse-header-at-point" t looking-at error "%s(): point is not looking at a bin header." cpio-bin-parse-header string-as-unibyte match-string-no-properties 0] 4 (#$ . 10137)]) #@378 Move the point to the beginning of the next bin 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-bin-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-bin-header-re* "cpio-bin-goto-next-header" nil re-search-forward t 0 match-string-no-properties point-marker] 4 (#$ . 10603)]) #@209 Build an internal structure reflecting the contents of the bin cpio archive in the current buffer. See the variable *cpio-catalog* for more information. CAVEAT: This respects neither narrowing nor the point. (defalias 'cpio-bin-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 \237. \207" [catalog those-contents contents-end contents-start filesize parsed-header "cpio-bin-build-catalog" nil t cpio-bin-goto-next-header cpio-bin-parse-header-at-point cpio-entry-size cg-round-up point-marker set-marker-insertion-type cpio-entry-name vector cpio-mode-entry-unmodified header-info that-header-string header-end header-start fname *cpio-bin-padding-modulus* *cg-insert-after*] 12 (#$ . 11274)]) #@102 Return the character position of the (ostensible) start of the trailer for the current cpio archive. (defalias 'cpio-bin-start-of-trailer #[nil "\303\304\305\306\n\"\210*\207" [end-of-contents fname *cpio-catalog* "cpio-bin-start-of-trailer" 0 mapc #[(ce) "\303!\304 !\305!\\\211)\207" [ce attrs end-of-contents cpio-entry-attrs-from-catalog-entry cpio-entry-size cpio-contents-start] 3]] 3 (#$ . 12188)]) #@98 Calculate the location of the end of the current archive once the TRAILER is written and padded. (defalias 'cpio-bin-end-of-archive #[nil "\303\304 \305\nG\\\306\"*\207" [end-of-contents fname *cpio-bin-trailer* "cpio-bin-end-of-archive" cpio-bin-start-of-trailer cg-round-up 512] 3 (#$ . 12607)]) #@63 Replace thed current trailer in the current cpio bin archive. (defalias 'cpio-bin-adjust-trailer #[nil "\301\302 \210\303 )\207" [fname "cpio-bin-adjust-trailer" cpio-bin-delete-trailer cpio-bin-insert-trailer] 1 (#$ . 12914)]) #@43 Insert a bin trailer into a cpio archive. (defalias 'cpio-bin-insert-trailer #[nil "\306 \211G\307  \307\nc\210db\210\310`S\f\"\211`ZT\311\f\312\"c\210 \211-\207" [fname *cpio-bin-trailer* base-trailer base-len len buffer-read-only "cpio-bin-insert-trailer" nil cg-round-up make-string 0 bro-before *cpio-bin-blocksize*] 4 (#$ . 13149)]) #@53 Delete the trailer in the current cpio bin archive. (defalias 'cpio-bin-delete-trailer #[nil "\305 \306=\204 \307\310\"\210eb\210\311\312\n\"\210 \313`d|\210\f\211*\207" [fname major-mode *cpio-catalog* buffer-read-only bro-before "cpio-bin-delete-trailer" cpio-mode error "%s(): Called outside of a cpio archive buffer." mapc #[(e) "@\304 !\305 !\306\n!\\\211b\210\307\310w+\207" [e ename attrs entry-end cpio-entry-attrs cpio-contents-start cpio-entry-size "" nil] 4] nil] 3 (#$ . 13504)]) #@35 Return the checksum for FILENAME. (defalias 'cpio-bin-make-chcksum-for-file #[(filename) "\300\207" [0] 1 (#$ . 14013)]) (provide 'cpio-bin)