;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #@137 Return a URI for the filename F. Multibyte characters are left as is. Use `rng-uri-escape-multibyte' to escape them using %HH. (fn F) (defalias 'rng-file-name-uri #[257 "\300!\262\301\302\303#\304G\305V\203\305H\306U\203\307\202\310Q\207" [expand-file-name replace-regexp-in-string "[]- \"#%;<>?[\\^`{|}]" rng-percent-encode "file:" 0 47 "//" "///"] 5 (#$ . 409)]) #@47 Escape multibyte characters in URI. (fn URI) (defalias 'rng-uri-escape-multibyte #[257 "\300\301\302\303\304\"#\207" [replace-regexp-in-string "[[:nonascii:]]" rng-percent-encode encode-coding-string utf-8] 7 (#$ . 796)]) #@12 (fn STR) (defalias 'rng-percent-encode #[257 "\300\301\302\303\304\305\"\262\"\"\207" [apply concat mapcar #[257 "\300\301\302\245\302\246#\207" [format "%%%x%x" 16] 6 "\n\n(fn CH)"] append nil] 9 (#$ . 1026)]) #@101 Return the filename represented by a URI. Signal an error if URI is not a valid file URL. (fn URI) (defalias 'rng-uri-file-name #[257 "\300\301\"\207" [rng-uri-file-name-1 nil] 4 (#$ . 1251)]) #@85 Return a regexp for filenames represented by URIs that match PATTERN. (fn PATTERN) (defalias 'rng-uri-pattern-file-name-regexp #[257 "\300\301\"\207" [rng-uri-file-name-1 match] 4 (#$ . 1452)]) #@16 (fn PATTERN) (defalias 'rng-uri-pattern-file-name-replace-match #[257 "\300\301\"\207" [rng-uri-file-name-1 replace] 4 (#$ . 1654)]) #@20 (fn URI PATTERN) (defalias 'rng-uri-file-name-1 #[514 "\301\302\"\204\f\303\304\"\210\305!\262\306!\206\303\307\"\211@A@\3108\301\311\"\3128\3138\204@\204M\303\314\n\"\210\202M\227\315\230\204M\303\316\n\"\210\317 \320B\235\204\\\303\321\n\"\210\203f\303\322\n\"\210\211\203p\303\323\n\"\210\301\324\"\203}\303\325\n\"\210\301\326\"\203\212\303\327\n\"\210\330=\203\243\203\243\331\332\333\"!\203\243\332\333\"\262\203\265\301\334\"\203\265\332\310\"\262\335\267\202\311\336!\202\314\337\310\"\202\314\340!\262\301\341\"\203\333\303\342\n\"\210\343=\203\357\203\352\344\202\353\345P\262\343=\203\375\346\347Q\202\350=\203\204\351P\202\207" [system-type string-match "\\`\\(?:[^%]\\|%[[:xdigit:]]{2}\\)*\\'" rng-uri-error "Bad escapes in URI `%s'" rng-uri-unescape-multibyte rng-uri-split "Cannot split URI `%s' into its components" 2 "\\`/" 3 4 "URI `%s' does not have a scheme" "file" "URI `%s' does not use the `file:' scheme" system-name (nil "" "localhost") "URI `%s' does not start with `file:///' or `file://localhost/'" "`?' not escaped in file URI `%s'" "URI `%s' has a fragment identifier" ";" "`;' not escaped in URI `%s'" "%2[fF]" "Escaped slash in URI `%s'" windows-nt file-name-absolute-p substring 1 "\\`\\./" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (match 188 replace 194)) rng-uri-unescape-unibyte-match rng-uri-unescape-unibyte-replace rng-uri-unescape-unibyte "" "URI `%s' has NUL character in path" match "\\(\\)" "\\(\\(?:[^/]*/\\)*\\)" "\\`" "\\'" replace "\\1"] 13 (#$ . 1796)]) #@19 (fn &rest ARGS) (defalias 'rng-uri-error #[128 "\300\301\302\303\"C\"\207" [signal rng-uri-error apply format-message] 6 (#$ . 3442)]) (define-error 'rng-uri-error "Invalid URI") #@12 (fn STR) (defalias 'rng-uri-split #[257 "\300\301\"\205\302\303\"\302\304\"\302\305\"\302\306\"\302\307\"\257\207" [string-match "\\`\\(?:\\([^:/?#]+\\):\\)?\\(?://\\([^/?#]*\\)\\)?\\([^?#]*\\)\\(?:\\?\\([^#]*\\)\\)?\\(?:#\\(\\(?:.\\|\n\\)*\\)\\)?\\'" match-string 1 2 3 4 5] 8 (#$ . 3630)]) #@58 (fn SCHEME AUTHORITY PATH &optional QUERY FRAGMENT-ID) (defalias 'rng-uri-join #[1283 "\205:\300\203\301D\262\203\302BB\262B\262\203)\303BB\262\2034\304BB\262\305\306\"\262\207" [nil "#" "?" "//" ":" apply concat] 9 (#$ . 3940)]) #@303 Resolve a possibly relative URI reference into absolute form. URI-REF is the URI reference to be resolved. BASE-URI is the base URI to use for resolving it. The algorithm is specified by RFC 2396. If there is some problem with URI-REF or BASE-URI, then URI-REF will be returned. (fn URI-REF BASE-URI) (defalias 'rng-uri-resolve #[514 "\300!\211@A@\3018\3028\3038\300!\203'\204'\211\203'\211@\204,\202d\211@\262\204X\211A@\262\304\232\203P\204P\3018\262\3028\262\202X\305\3018\"\262\306%\207" [rng-uri-split 2 3 4 "" rng-resolve-path rng-uri-join] 15 (#$ . 4207)]) #@23 (fn PATH BASE-PATH) (defalias 'rng-resolve-path #[514 "\300\301\"\204\300\301\"\204\207\302!\302!\211G\303V\203'\304!\244\262\202/@@P\240\210\305!\211@\306\232\203=\211\307\240\210\210\310\306\"\262\311\211\311\262A\262\203\207\211\204\207A@\312\232\203d@\312\232\203kA\262\202M\311\240\210AAA?\205y\307\240\210\313\262\314\311\"\262\202M\211\204F\266\315!\207" [string-match "\\`/" rng-split-path 1 nbutlast last "." "" delete nil ".." t delq rng-join-path] 9 (#$ . 4821)]) #@164 Return a URI that relative to BASE is equivalent to FULL. The returned URI will be relative if possible. Both FULL and BASE must be absolute URIs. (fn FULL BASE) (defalias 'rng-relative-uri #[514 "\300!\211@A@\3018\3028\3038\300!\203R\211\203R\203R@\232\203R\304\262\203CA@\232\203C\304\262\305\3018\"\262\306%\202T\207" [rng-uri-split 2 3 4 nil rng-relative-path rng-uri-join] 15 (#$ . 5350)]) #@23 (fn PATH BASE-PATH) (defalias 'rng-relative-path #[514 "\300!\300!\211G\301V\203\302!\262\303\235\204*\304\235\204*\303\235\204*\304\235\203.\202h\203I\211\203I@@\230\203IA\262\211A\262\202.\211\203Y\211A\262\304B\262\202I@\305\232\203e\303B\262\306!\207" [rng-split-path 1 nbutlast "." ".." "" rng-join-path] 6 (#$ . 5791)]) #@13 (fn PATH) (defalias 'rng-split-path #[257 "\300\301\302\303#\203\304\300\224#B\262\300\225\262\202\304\"B\237\207" [0 nil string-match "/" substring] 7 (#$ . 6161)]) #@17 (fn SEGMENTS) (defalias 'rng-join-path #[257 "\211\205 \300\301\302#\207" [mapconcat identity "/"] 5 (#$ . 6349)]) #@12 (fn STR) (defalias 'rng-uri-unescape-multibyte #[257 "\300\301\302#\207" [replace-regexp-in-string "\\(?:%[89a-fA-F][[:xdigit:]]\\)+" rng-multibyte-percent-decode] 5 (#$ . 6474)]) #@12 (fn STR) (defalias 'rng-multibyte-percent-decode #[257 "\300\301\302\303\304\305\306\"\"\"\307\"\207" [decode-coding-string apply string mapcar #[257 "\300\301\"\207" [string-to-number 16] 4 "\n\n(fn H)"] split-string "%" utf-8] 9 (#$ . 6663)]) #@12 (fn STR) (defalias 'rng-uri-unescape-unibyte #[257 "\300\301\302\303\211%\207" [replace-regexp-in-string "%[0-7][[:xdigit:]]" #[257 "\300\301\302\"\303\"\207" [string-to-number substring 1 16] 5 "\n\n(fn H)"] t] 7 (#$ . 6919)]) #@12 (fn STR) (defalias 'rng-uri-unescape-unibyte-match #[257 "\300\301\302\303\211%\207" [replace-regexp-in-string "%[0-7][[:xdigit:]]\\|[^%]" #[257 "\211\300\230\203\301\207\302G\303U\203\202\304\305\303\"\306\"!\207" ["*" "\\([^/]*\\)" regexp-quote 1 string-to-number substring 16] 6 "\n\n(fn MATCH)"] t] 7 (#$ . 7157)]) #@29 (fn STR NEXT-MATCH-INDEX) (defalias 'rng-uri-unescape-unibyte-replace #[514 "\211C\300\301\302\303\304\305\306!\307\"\310\311%\312\211%\207" [replace-regexp-in-string "%[0-7][[:xdigit:]]\\|[^%]" make-byte-code 257 "\211\301\230\203\300\242\300T\240\210\302\303\"\207\211G\304U\203\211\305H\202&\306\307\304\"\310\"\211\311=\2033\312\311\211\"\2026\312!\207" vconcat vector ["*" format "\\%s" 1 0 string-to-number substring 16 92 string] 5 "\n\n(fn MATCH)" t] 11 (#$ . 7494)]) (provide 'rng-uri)