Common Lisp Package: CL-STORE

README:

FUNCTION

Public

FIND-BACKEND (NAME &OPTIONAL ERRORP)

Return backup called NAME. If there is no such backend NIL is returned if ERRORP is false, otherwise an error is signalled.

READ-32-BIT

Read a signed or unsigned byte off STREAM.

RESTORE-OBJECT (PLACE &OPTIONAL (BACKEND *CURRENT-BACKEND*))

Restore the object in PLACE using BACKEND

STORE-32-BIT

Write OBJ down STREAM as a 32 bit integer.

STORE-OBJECT (OBJ STREAM &OPTIONAL (BACKEND *CURRENT-BACKEND*))

Store OBJ into STREAM. Not meant to be overridden, use backend-store-object instead

Undocumented

ALIAS-BACKEND (OLD ALIAS)

CREATE-SERIALIZE-HASH (&KEY (SIZE *STORE-HASH-SIZE*))

FLOAT-TYPE (FLOAT)

GET-FLOAT-TYPE (NUM)

MAKE-REFERRER (&KEY ((VAL DUM90) NIL))

OUTPUT-TYPE-CODE (CODE STREAM)

REGISTER-CODE (CODE NAME &OPTIONAL (ERRORP NIL))

SETFRESTORE (NEW-VAL PLACE &OPTIONAL (BACKEND *DEFAULT-BACKEND*))

RESTORE-ERROR (FORMAT-STRING &REST ARGS)

STORE-ERROR (FORMAT-STRING &REST ARGS)

Private

CREATE-FLOAT-VALUES (VALUE &REST CODES)

Returns a alist of special float to float code mappings.

DELAY-COMPLETED (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DELAY-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GET-RESTORE-MACRO (NAME)

Return the defrestore-? macro which will be used by a custom backend

GET-STORE-MACRO (NAME)

Return the defstore-? macro which will be used by a custom backend

NEEDS-CHECKP (OBJ)

Do we need to check if this object has been stored before?

NEW-VAL

Tries to get a referred value to reduce unnecessary cirularity fixing.

REFERRED-VALUE (REFERRER HASH)

Return the value REFERRER is meant to be by looking in HASH.

REFERRER-VAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SAFE-LENGTH (LIST)

Similar to `list-length', but avoid errors on improper lists. Return two values: the length of the list and the last cdr. Modified to work on non proper lists.

SDEF-INFO (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SDEF-SUPERS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SEEN

Has this object already been stored?

SYMBOLICATE (&REST SYMS)

Concatenate all symbol names into one big symbol

UNICODE-STRING-P

An implementation specific test for a unicode string.

UPDATE-SEEN

Register OBJ as having been stored.

Undocumented

BACKEND-DESIGNATOR->BACKEND (DESIGNATOR)

BITS->NUM (BITS)

CL-STORE-REPORT (CONDITION STREAM)

COPY-DELAY (INSTANCE)

COPY-REFERRER (INSTANCE)

COPY-STRUCT-DEF (INSTANCE)

CORRECT-LIST-STORE (LIST STREAM)

CREATE-MAKE-FOO (DD)

DD-NAME (DD)

SETFDELAY-COMPLETED (NEW-VALUE INSTANCE)

DELAY-P (OBJECT)

SETFDELAY-VALUE (NEW-VALUE INSTANCE)

DUMP-INT

DUMP-STRING

ENSURE-CLASS (NAME &REST ARGS)

EXTERNAL-SYMBOLS (PACKAGE)

FORCE (DELAY)

GET-CLASS-FORM (NAME FIELDS EXTENDS)

GET-FUNCTION-NAME (OBJ)

GET-INFO (OBJ)

GET-LAYOUT (OBJ)

GET-REF

GET-RESTORE-HASH

GET-STORE-HASH

GET-SUPERS (OBJ)

HANDLE-NORMAL

HANDLE-RESTORE

INFO-OR-DIE (OBJ)

INTERNAL-SYMBOLS (PACKAGE)

ITERATIVE-LIST-STORE (LIST STREAM)

KWD (NAME)

LOOKUP-CODE

LOOKUP-READER (VAL READERS)

MAKE-DELAY (&KEY ((VALUE DUM0) NIL) ((COMPLETED DUM1) NIL))

MAKE-STRUCT-DEF (&KEY ((SUPERS DUM65) (REQUIRED-ARG SUPERS)) ((INFO DUM66) (REQUIRED-ARG INFO)))

MKSTR (&REST ARGS)

NUM->BITS (NUM)

PARSE-NAME (NAME)

READ-LIST-CODE (STREAM)

READ-TYPE-CODE (STREAM)

REFERRER-P (OBJECT)

SETFREFERRER-VAL (NEW-VALUE INSTANCE)

REGISTER-BACKEND (NAME CLASS MAGIC-NUMBER STREAM-TYPE OLD-MAGIC-NUMBERS COMPATIBLE-MAGIC-NUMBERS)

REMOVE-REMAINING (TIMES STREAM)

REQUIRED-ARG (NAME)

RESTORE-FROM-FILE (PLACE BACKEND)

RESTORE-PACKAGE (PACKAGE-NAME STREAM &KEY FORCE)

RESTORE-TYPE-OBJECT (STREAM)

SAVE-ABLE-SUPERS (OBJ)

SB-KERNEL-DEFSTRUCT (DD SUPERS SOURCE)

SBCL-DEFINE-STRUCTURE (DD SUPERS)

SBCL-STRUCT-DEFS (INFO)

SETFSDEF-INFO (NEW-VALUE INSTANCE)

SETFSDEF-SUPERS (NEW-VALUE INSTANCE)

SETUP-SPECIAL-FLOATS

STORE-32-BIT-INTEGER

STORE-ARBITRARY-INTEGER (OBJ STREAM)

STORE-ARRAY

STORE-LIST-CODE (X STREAM)

STORE-SIMPLE-BASE-STRING

STORE-SIMPLE-BYTE-VECTOR

STORE-SIMPLE-STRING

STORE-SIMPLE-VECTOR

STORE-TO-FILE (OBJ PLACE BACKEND)

STORE-TYPE-OBJECT (OBJ STREAM)

STRUCT-DEF-P (OBJECT)

SUPER-LAYOUT (SUPER)

SUPER-LAYOUTS (SUPERS)

UNDUMP-INT

UNDUMP-STRING

UPDATE-RESTORED

MACRO

Public

DEFBACKEND (NAME &KEY (STREAM-TYPE ''(UNSIGNED-BYTE 8)) (MAGIC-NUMBER NIL) FIELDS (EXTENDS '(BACKEND)) (OLD-MAGIC-NUMBERS NIL) (COMPATIBLE-MAGIC-NUMBERS NIL))

Defines a new backend called NAME. Stream type must be either 'char or 'binary. FIELDS is a list of legal slots for defclass. MAGIC-NUMBER, when supplied, will be written down stream as verification and checked on restoration. EXTENDS is a class to extend, which must be backend or a class which extends backend

RESOLVING-OBJECT ((VAR CREATE) &BODY BODY)

Execute body attempting to resolve circularities found in form CREATE.

SETTING (PLACE GET)

Resolve the possible referring object retrieved by GET and set it into PLACE. Only usable within a resolving-object form.

SETTING-HASH (GETTING-KEY GETTING-VALUE)

Insert the value retrieved by GETTING-VALUE with the key retrieved by GETTING-KEY, resolving possible circularities. Only usable within a resolving-object form.

WITH-BACKEND (BACKEND &BODY BODY)

Run BODY with *default-backend* bound to BACKEND

WITH-SERIALIZATION-UNIT ((&KEY STORE-HASH RESTORE-HASH) &BODY BODY)

Executes body in a single serialization unit allowing various internal data structures to be reused. The keys store-hash and restore-hash are expected to be either nil or hash-tables as produced by the function create-serialize-hash.

Undocumented

DEFRESTORE-CL-STORE ((TYPE PLACE &OPTIONAL QUALIFIER) &BODY BODY)

DEFSTORE-CL-STORE ((VAR TYPE STREAM &OPTIONAL QUALIFIER) &BODY BODY)

Private

Undocumented

AIF (TEST THEN &OPTIONAL ELSE)

DELAY (&REST BODY)

MAKE-UB32 (A B C D)

WHEN-LET ((VAR TEST) &BODY BODY)

WITH-GENSYMS (NAMES &BODY BODY)

GENERIC-FUNCTION

Public

BACKEND-RESTORE (BACKEND PLACE)

Wrapped by restore. Override this to do custom restoration

BACKEND-RESTORE-OBJECT (BACKEND PLACE)

Find the next function to call with BACKEND and invoke it with PLACE.

BACKEND-STORE (BACKEND PLACE OBJ)

Method wrapped by store, override this method for custom behaviour (see circularities.lisp).

BACKEND-STORE-OBJECT (BACKEND OBJ STREAM)

Wrapped by store-object, override this to do custom storing (see circularities.lisp for an example).

CHECK-MAGIC-NUMBER (BACKEND STREAM)

Check to see if STREAM actually contains a stored object for BACKEND.

GET-NEXT-READER (BACKEND PLACE)

Method which must be specialized for BACKEND to return the next function to restore an object from PLACE. If no reader is found return a second value which will be included in the error.

GET-SLOT-DETAILS (SLOT-DEFINITION)

Return a list of slot details which can be used as an argument to ensure-class

INTERNAL-STORE-OBJECT (BACKEND OBJ PLACE)

Method which is specialized by defstore-? macros.

RESTORE (PLACE &OPTIONAL BACKEND)

Restore and object FROM PLACE using BACKEND. Not meant to be overridden, use backend-restore instead

SERIALIZABLE-SLOTS (OBJECT)

Return a list of slot-definitions to serialize. The default is to call serializable-slots-using-class with the object and the objects class

SERIALIZABLE-SLOTS-USING-CLASS (OBJECT CLASS)

Return a list of slot-definitions to serialize. The default calls compute slots with class

STORE (OBJ PLACE &OPTIONAL DESIGNATOR)

Store OBJ into Stream PLACE using backend BACKEND.

STORE-BACKEND-CODE (BACKEND STREAM)

Store magic-number of BACKEND, when present, into STREAM.

STORE-REFERRER (BACKEND OBJ PLACE)

Store the number OBJ into PLACE as a referrer for BACKEND.

Undocumented

CAUSED-BY (CONDITION)

SETFCAUSED-BY (NEW-VALUE CONDITION)

INT-OR-CHAR-P (BACKEND FN)

REFERRERP (BACKEND READER)

Private

Undocumented

CLASS-DIRECT-DEFAULT-INITARGS (CLASS)

SETFCLASS-DIRECT-SLOTS (NEW-VALUE SLOT-CLASS)

SETFCLASS-SLOTS (NEW-VALUE SLOT-CLASS)

COMPUTE-SLOTS (CLASS)

FORMAT-ARGS (CONDITION)

SETFFORMAT-ARGS (NEW-VALUE CONDITION)

FORMAT-STRING (CONDITION)

SETFFORMAT-STRING (NEW-VALUE CONDITION)

SETFGENERIC-FUNCTION-NAME (NEW-VALUE STANDARD-GENERIC-FUNCTION)

INTERNAL-RESTORE-OBJECT (BACKEND TYPE PLACE)

SLOT-ACCESSOR

Public

Undocumented

MAGIC-NUMBER (OBJECT)

SETFMAGIC-NUMBER (NEW-VALUE OBJECT)

RESTORERS (OBJECT)

SETFRESTORERS (NEW-VALUE OBJECT)

STREAM-TYPE (OBJECT)

SETFSTREAM-TYPE (NEW-VALUE OBJECT)

Private

Undocumented

CLASS-DIRECT-SLOTS (CLASS)

CLASS-DIRECT-SUPERCLASSES (CLASS)

CLASS-SLOTS (CLASS)

COMPATIBLE-MAGIC-NUMBERS (OBJECT)

SETFCOMPATIBLE-MAGIC-NUMBERS (NEW-VALUE OBJECT)

GENERIC-FUNCTION-NAME (STANDARD-GENERIC-FUNCTION)

NAME (OBJECT)

SETFNAME (NEW-VALUE OBJECT)

OLD-MAGIC-NUMBERS (OBJECT)

SETFOLD-MAGIC-NUMBERS (NEW-VALUE OBJECT)

SLOT-DEFINITION-ALLOCATION (SLOTD)

SETFSLOT-DEFINITION-ALLOCATION (NEW-VALUE STANDARD-SLOT-DEFINITION)

SLOT-DEFINITION-INITARGS (SLOT-DEFINITION)

SETFSLOT-DEFINITION-INITARGS (NEW-VALUE SLOT-DEFINITION)

SLOT-DEFINITION-INITFORM (SLOT-DEFINITION)

SETFSLOT-DEFINITION-INITFORM (NEW-VALUE SLOT-DEFINITION)

SLOT-DEFINITION-NAME (SLOT-DEFINITION)

SETFSLOT-DEFINITION-NAME (NEW-VALUE SLOT-DEFINITION)

SLOT-DEFINITION-READERS (SLOT-DEFINITION)

SETFSLOT-DEFINITION-READERS (NEW-VALUE SLOT-DEFINITION)

SLOT-DEFINITION-TYPE (SLOT-DEFINITION)

SETFSLOT-DEFINITION-TYPE (NEW-VALUE SLOT-DEFINITION)

SLOT-DEFINITION-WRITERS (SLOT-DEFINITION)

SETFSLOT-DEFINITION-WRITERS (NEW-VALUE SLOT-DEFINITION)

VARIABLE

Public

*NUKE-EXISTING-CLASSES*

Do we overwrite existing class definitions on restoration.

*NUKE-EXISTING-PACKAGES*

Whether or not to overwrite existing packages on restoration.

*PRECISE-LIST-STORAGE*

When bound to true the precise list serializer will be used which will ensure that all shared structure in a list will be serialized and deserialized correctly. This method of storing lists, while more correct than the default, will NOT work with large lists as it will blow the stack. Binding this variable to true only affects storing and makes no difference when restoring lists.

*STORE-CLASS-SLOTS*

Whether or not to serialize slots which are class allocated.

*STORE-CLASS-SUPERCLASSES*

Whether or not to store the superclasses of a stored class.

*STORE-USED-PACKAGES*

If non-nil will serialize each used package otherwise will only store the package name

Undocumented

*CHECK-FOR-CIRCS*

*DEFAULT-BACKEND*

*RESTORE-HASH-SIZE*

*STORE-HASH-SIZE*

Private

*CHAR-MARKER*

Largest character that can be represented in 8 bits

*REGISTERED-BACKENDS*

An assoc list mapping backend-names to the backend objects

Undocumented

*CDR-CODE*

*EOL-CODE*

*RESTORERS*

*SBCL-READTABLE*

*SBCL-STRUCT-INHERITS*

*SPECIAL-FLOATS*

+32-BIT-INTEGER-CODE+

+ARRAY-CODE+

+BUILT-IN-CLASS-CODE+

+BUILT-IN-FUNCTION-CODE+

+CHARACTER-CODE+

+COMPLEX-CODE+

+CONDITION-CODE+

+CONS-CODE+

+CORRECT-CONS-CODE+

+FLOAT-CODE+

+FUNCTION-CODE+

+GENSYM-CODE+

+GF-CODE+

+HASH-TABLE-CODE+

+INTEGER-CODE+

+ITERATIVE-CONS-CODE+

+NIL-CODE+

+PACKAGE-CODE+

+PATHNAME-CODE+

+RATIO-CODE+

+REFERRER-CODE+

+SIMPLE-BASE-STRING-CODE+

+SIMPLE-BYTE-VECTOR-CODE+

+SIMPLE-STRING-CODE+

+SIMPLE-VECTOR-CODE+

+SPECIAL-FLOAT-CODE+

+STANDARD-CLASS-CODE+

+STANDARD-OBJECT-CODE+

+STRUCT-DEF-CODE+

+STRUCTURE-CLASS-CODE+

+STRUCTURE-OBJECT-CODE+

+SYMBOL-CODE+

+T-CODE+

+UNICODE-BASE-STRING-CODE+

+UNICODE-STRING-CODE+

CLASS

Public

BACKEND

Core class which custom backends must extend

CL-STORE

Autogenerated cl-store class for backend cl-store.

RESOLVING-BACKEND

A backend which does the setup for resolving circularities.

Private

Undocumented

DELAY (&REST BODY)

REFERRER

SLOT-DEFINITION

STRUCT-DEF

CONDITION

Public

CL-STORE-ERROR

Root cl-store condition

RESTORE-ERROR (FORMAT-STRING &REST ARGS)

Error thrown when restoring an object fails.

STORE-ERROR (FORMAT-STRING &REST ARGS)

Error thrown when storing an object fails.

CONSTANT

Private

Undocumented

+DOUBLE-FLOAT-INF+

+DOUBLE-FLOAT-NAN+

+DOUBLE-FLOAT-NEG-INF+

+LONG-FLOAT-INF+

+LONG-FLOAT-NAN+

+LONG-FLOAT-NEG-INF+

+SHORT-FLOAT-INF+

+SHORT-FLOAT-NAN+

+SHORT-FLOAT-NEG-INF+

+SINGLE-FLOAT-INF+

+SINGLE-FLOAT-NAN+

+SINGLE-FLOAT-NEG-INF+