Common Lisp Package: BITFIELD-SCHEMA

README:

FUNCTION

Public

GET-INTEGER (BIT-FIELD OFFSET WIDTH)

Get WIDTH bits of an integer from simple-bit-vector BIT-FIELD starting at OFFFSET.

PUT-INTEGER (INTEGER BIT-FIELD OFFSET WIDTH)

Put WIDTH bits of given INTEGER into simple-bit-vector BIT-FIELD starting at OFFSET.

PUT-INTEGER/GROW (INTEGER BIT-FIELD OFFSET WIDTH)

Put WIDTH bits of given INTEGER into BIT-FIELD simple-bit-vector at OFFSET. Twices the BIT-FIELD size of it's current length less than (+ OFFSET WIDTH) by creating a new simple-bit-vector and copying the old data into it.

Private

Undocumented

CHECK-CONTEXT-ARGS (PREFIX &KEY OFFSET GEN-SIZE GEN-MAKE)

CHECK-CONTEXT-DECL-ARGS (PREFIX DECLS NAME &KEY WIDTH COUNT GEN-GET GEN-SET)

CHECK-NUMBER-OR-REF-VALID-P (PREFIX NAME FIELD DECLS &KEY ALLOW-NIL)

GEN-ADD (&REST FORMS)

GEN-GETTER (CTX DECL)

GEN-MULTIPLY (FORM MULTIPLIER)

GEN-NOQUOTE (SEXP)

GEN-QUASIQUOTE (SEXP)

GEN-SETTER (CTX DECL)

GEN-TOPLEVEL (TYPE FORM)

MAKE-CONTEXT (PREFIX CONTEXT-KEYS DECLARATIONS)

POWER-OF-2-P (NUMBER)

REAL-WIDTH (CTX FIELD)

MACRO

Public

DEFBITFIELD-SCHEMA (PREFIX (&REST SCHEMA-KEYS) &REST DECLARATIONS)

Given the virtual markup of a simple-bit-vector bitfield generate effective accessors for them. Example: (defbitfield-schema tree-node (:offset offt) (disabled-p :width 1) (values :width 16 :count 10) (left-child :width 24) (right-child :width 7)) :OFFSET parameter could be a number constant, a variable or could be omited at all.

GET-INTEGER/FIXED (BIT-FIELD OFFSET WIDTH)

Effectively get WIDTH bits of an integer from simple-bit-vector BIT-FIELD starting at OFFFSET (only when WIDTH is a number).

Private

Undocumented

WITH-BITFIELD-SCHEMA (((&REST SCHEMA-KEYS) &REST DECLARATIONS) &BODY BODY)

GENERIC-FUNCTION

Private

Undocumented

CONST-FIELD-P (CTX FIELD &OPTIONAL REC-PATH)

GEN-BASE-PARAM-TYPES (CTX)

GEN-COMMON-ARGS (CTX DECL &KEY (GEN-INDEX T) GEN-VALUE)

GEN-COMMON-BASE-ARGS (CTX &KEY GEN-VALUE)

GEN-FIELD-SHIFT (CTX DECL ADJUST-CONST ADJUST-FORM)

GEN-GET-VALUE-FORM (CTX FIELD)

GEN-GETTER-ARGS (CTX DECL)

GEN-GETTER-BODY (CTX DECL)

GEN-GETTER-DEF (CTX DECL)

GEN-GETTER-ID (CTX DECL)

GEN-GETTER-NAME (CTX DECL)

GEN-MAKE-ID (CTX)

GEN-MAKE-PROC (CTX)

GEN-OFFSET-FORM (CTX DECL &KEY SKIP-OFFSET)

GEN-OFFSET-FORM-ADJUST (CTX DECL)

GEN-PARAM-TYPE (CTX DECL)

GEN-PARAM-TYPES (CTX DECL &KEY SET-VALUE)

GEN-RESOLVE-VALUE (CTX DECL READER)

GEN-SET-VALUE-FORM (CTX FIELD)

GEN-SETTER-ARGS (CTX DECL)

GEN-SETTER-BODY (CTX DECL)

GEN-SETTER-DEF (CTX DECL)

GEN-SETTER-ID (CTX DECL)

GEN-SETTER-NAME (CTX DECL)

GEN-SIZE-ID (CTX)

GEN-SIZE-PROC (CTX)

SLOT-ACCESSOR

Private

Undocumented

BIT-FIELD-VAR (OBJECT)

DECL-COUNT (OBJECT)

SETFDECL-COUNT (NEW-VALUE OBJECT)

DECLS (OBJECT)

SETFDECLS (NEW-VALUE OBJECT)

GEN-GET (OBJECT)

SETFGEN-GET (NEW-VALUE OBJECT)

GEN-MAKE (OBJECT)

SETFGEN-MAKE (NEW-VALUE OBJECT)

GEN-SET (OBJECT)

SETFGEN-SET (NEW-VALUE OBJECT)

GEN-SIZE (OBJECT)

SETFGEN-SIZE (NEW-VALUE OBJECT)

INDEX-VAR (OBJECT)

NAME (OBJECT)

SETFNAME (NEW-VALUE OBJECT)

OFFSET (OBJECT)

SETFOFFSET (NEW-VALUE OBJECT)

OFFSET-VAR (OBJECT)

PREFIX (OBJECT)

SETFPREFIX (NEW-VALUE OBJECT)

VALUE-VAR (OBJECT)

WIDTH (OBJECT)

SETFWIDTH (NEW-VALUE OBJECT)

VARIABLE

Private

Undocumented

*CTX-POOL*

CLASS

Private

Undocumented

GEN-CONTEXT

GEN-CONTEXT-DECL