;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require cl-lib cl-extra eieio eieio-base] 2) (defvar pcache-directory (byte-code "\302P\303 \304\"\210 )\207" [user-emacs-directory dir "var/pcache/" make-directory t] 3)) (defvar *pcache-repositories* (make-hash-table :test 'equal)) (defconst pcache-default-save-delay 300) (defconst pcache-internal-version-constant "0.5") (defconst pcache-version-constant (format "%s/%s" emacs-version pcache-internal-version-constant)) (byte-code "\300\301\302\303!\"\210\300\304\305\303!\"\210\300\306\304\"\210\307\306\310\311#\210\312\303\313\304#\314\303\315\316\317$\207" [defalias pcache-repository-p eieio-make-class-predicate pcache-repository pcache-repository--eieio-childp eieio-make-child-predicate pcache-repository-child-p make-obsolete "use (cl-typep ... \\='pcache-repository) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal (eieio-persistent eieio-named) ((version :initarg :version :initform nil) (version-constant :allocation :class) (entries :initarg :entries :initform (make-hash-table)) (entry-cls :initarg :entry-cls :initform pcache-entry) (timestamp :initarg :timestamp :initform (float-time (current-time))) (save-delay :initarg :save-delay)) nil] 6) #@56 Create a new object of class type `pcache-repository'. (defalias 'pcache-repository #[(&rest slots) "\301\302\303#\207" [slots apply make-instance pcache-repository] 4 (#$ . 1353)]) (byte-code "\300\301\302\303#\300\207" [function-put pcache-repository compiler-macro pcache-repository--anon-cmacro] 4) (defalias 'pcache-repository--anon-cmacro #[(whole &rest slots) "@;\204 \207\302\303\304@ @# @\305@DABB\"\207" [slots whole macroexp-warn-and-return format "Obsolete name arg %S to constructor %S" identity] 5]) (byte-code "\302\303\304#\210\302\303\305 #\207" [pcache-default-save-delay pcache-version-constant eieio-oset-default pcache-repository :save-delay version-constant] 4) (defvar *pcache-repository-name* nil) (cl-generic-define-method 'make-instance nil '((cls (subclass pcache-repository)) &rest args) t #[(#1=#:cl--cnm cls &rest args) "@;\203 @\206\306\307\"\206 \206\310\n!\311 \f\" P\312\307 D\" \206\245\313\314!\204p\315!\203p\3161k\317\f \320\321\317# \322 !\204[\323\324!\205f\325  \f#\205f +0\202m\210\326\206\245! \327!\" \315\"!\204\210\330\"\317\"\210\331 \332#\210\331 \333\334 \335\"#\210\325  \f#\210 *+\207" [args *pcache-repository-name* cls newname *pcache-repositories* e plist-get :object-name symbol-name gethash append boundp pcache-avoid-recursion file-exists-p (error) t eieio-persistent-read pcache-repository pcache-validate-repo error "wrong version" puthash nil file-name-directory make-directory eieio-oset :file :version eieio-oref-default version-constant pcache-directory path obj #1# dir] 6 "\n\n(fn CLS &rest ARGS)"]) (defalias 'pcache-hash-table-values #[(h) "\302\303\304 \"\210)\207" [values h nil maphash #[(k v) " B\211\207" [v values] 2]] 3]) (byte-code "\300\301\302\303\302\304%\210\300\301\302\305\302\306%\210\307\310\311\312!\"\210\307\313\314\312!\"\210\307\315\313\"\210\316\315\317\320#\210\321\312\322\313#\323\312\302\324\302$\207" [cl-generic-define-method pcache-validate-repo nil ((cache t)) #[(cache) "\300\207" [nil] 1] ((cache pcache-repository)) #[(cache) "\301\302\"\303\304!\305\"\232\205 \306\301\307\"!\205 \310\311\312\301\307\"!\"\207" [cache eieio-oref version eieio-oref-default eieio-object-class version-constant hash-table-p entries cl-every #[(entry) "\302\303 \304\"\"\205 \305!\207" [entry cache object-of-class-p eieio-oref entry-cls pcache-validate-entry] 5] pcache-hash-table-values] 6] defalias pcache-entry-p eieio-make-class-predicate pcache-entry pcache-entry--eieio-childp eieio-make-child-predicate pcache-entry-child-p make-obsolete "use (cl-typep ... \\='pcache-entry) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal ((timestamp :initarg :timestamp :initform (float-time (current-time))) (ttl :initarg :ttl :initform nil) (value :initarg :value :initform nil) (value-cls :initarg :value-cls :initform nil))] 6) #@51 Create a new object of class type `pcache-entry'. (defalias 'pcache-entry #[(&rest slots) "\301\302\303#\207" [slots apply make-instance pcache-entry] 4 (#$ . 4270)]) (byte-code "\300\301\302\303#\300\207" [function-put pcache-entry compiler-macro pcache-entry--anon-cmacro] 4) (defalias 'pcache-entry--anon-cmacro #[(whole &rest slots) "@;\204 \207\302\303\304@ @# @\305@DABB\"\207" [slots whole macroexp-warn-and-return format "Obsolete name arg %S to constructor %S" identity] 5]) (byte-code "\300\301\302\303\302\304%\210\300\301\302\305\302\306%\210\300\307\302\310\302\311%\210\300\312\302\313\302\314%\210\300\315\302\316\302\317%\210\300\320\302\321\302\322%\210\300\323\302\324\302\325%\210\300\326\302\327\302\330%\210\300\331\302\332\302\333%\210\300\334\302\335\302\336%\210\300\337\302\340\302\341%\207" [cl-generic-define-method pcache-validate-entry nil ((entry t)) #[(entry) "\300\207" [nil] 1] ((entry pcache-entry)) #[(entry) "\301\302\"?\206\303\301\304\"\301\302\"\"\207" [entry eieio-oref value-cls object-of-class-p value] 5] pcache-entry-valid-p ((entry pcache-entry)) #[(entry) "\303\301\"\211?\206\304\305 !\211 \303\306\"\\W))\207" [entry ttl time eieio-oref float-time current-time timestamp] 6] pcache-get ((cache pcache-repository) key &optional default) #[(cache key &optional default) "\305\306\"\307\n \"\211\203$\310 !\203\305 \311\"\202%\312\n \"\210\f\202%\f*\207" [cache table key entry default eieio-oref entries gethash pcache-entry-valid-p value remhash] 4] pcache-has ((cache pcache-repository) key) #[(cache key) "\305\306!\307 \310\"\311 \n#\211=?\205\312\f!\205\313+\207" [default cache table key entry make-symbol ":nil" eieio-oref entries gethash pcache-entry-valid-p t] 5] pcache-put ((cache pcache-repository) key value &optional ttl) #[(cache key value &optional ttl) "\306\307\"\310 !\203\311 \312\"\203 \206'\313\306\314\"\315 \316\310 !\205&\317 !%\f\2033\320\n\321\f#\210\322 \n #\323!\210*\207" [cache value entry table ttl key eieio-oref entries eieio-object-p object-of-class-p pcache-entry make-instance entry-cls :value :value-cls eieio-object-class eieio-oset :ttl puthash pcache-save] 8] pcache-invalidate ((cache pcache-repository) key) #[(cache key) "\303\304\"\305\n \"\210\306!)\207" [cache table key eieio-oref entries remhash pcache-save] 3] pcache-clear ((cache pcache-repository)) #[(cache) "\306\301\"\307 !\310 !\311 !\312 !\313\314\315\316\n\317 \320\f\321 &#\210-\322!\207" [cache entries test resize threshold weakness eieio-oref hash-table-test hash-table-rehash-size hash-table-rehash-threshold hash-table-weakness eieio-oset :entries make-hash-table :test :rehash-size :rehash-threshold :weakness pcache-save] 12] pcache-purge-invalid ((cache pcache-repository)) #[(cache) "\302\303\"\304\305 \"\210\306!)\207" [cache table eieio-oref entries maphash #[(k e) "\303!?\205 \304 \n\"\207" [e k table pcache-entry-valid-p remhash] 3] pcache-save] 3] pcache-save ((cache pcache-repository) &optional force) #[(cache &optional force) "\305\303\"\305\306\"\307\310 !\f\204 \n\\V\205/\311\312 #\210\311\313\314\315!\316\"#\210\317!+\207" [cache time delay timestamp force eieio-oref save-delay float-time current-time eieio-oset :timestamp :version eieio-oref-default eieio-object-class version-constant eieio-persistent-save] 6] pcache-map ((cache pcache-repository) func) #[(cache func) "\303\304\"\305\n \")\207" [cache table func eieio-oref entries maphash] 3]] 6) (defalias 'pcache-kill-emacs-hook #[nil "\301\302\"\207" [*pcache-repositories* maphash #[(k v) "\3011\f\302!0\210\202 \210\3031\304\305\"0\207\210\306\207" [v (error) pcache-purge-invalid (error) pcache-save t nil] 3]] 3]) (defalias 'pcache-destroy-repository #[(name) "\304 \"\210\nP\305 !\205\306 !)\207" [name *pcache-repositories* pcache-directory fname remhash file-exists-p delete-file] 3]) (byte-code "\304\305\306\"\210\307\310\311 \"\210\307\211\203# @\312\n \"\210 A\211\204+\313\314!\207" [to-clean *pcache-repositories* k --dolist-tail-- add-hook kill-emacs-hook pcache-kill-emacs-hook nil maphash #[(k v) "\3041\305\306\307\" \"?\205\310\311\312\"0\207\210\n B\211\207" [v pcache-version-constant k to-clean (error) eql eieio-oref version signal error nil] 4] remhash provide pcache] 4)