The cffi-ops Reference Manual

This is the cffi-ops Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 14:53:08 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cffi-ops

A library that helps write concise CFFI-related code.

Maintainer

Bohong Huang <>

Author

Bohong Huang <>

Home Page

https://github.com/bohonghuang/cffi-ops

Source Control

(GIT https://github.com/bohonghuang/cffi-ops.git)

Bug Tracker

https://github.com/bohonghuang/cffi-ops/issues

License

Apache-2.0

Version

1.0.0

Dependencies
  • alexandria (system).
  • cffi (system).
  • arrow-macros (system).
  • trivial-macroexpand-all (system).
Source

cffi-ops.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cffi-ops/cffi-ops.asd

Source

cffi-ops.asd.

Parent Component

cffi-ops (system).

ASDF Systems

cffi-ops.


3.1.2 cffi-ops/package.lisp

Source

cffi-ops.asd.

Parent Component

cffi-ops (system).

Packages

cffi-ops.


3.1.3 cffi-ops/walker.lisp

Dependency

package.lisp (file).

Source

cffi-ops.asd.

Parent Component

cffi-ops (system).

Internals

3.1.4 cffi-ops/setf.lisp

Dependencies
Source

cffi-ops.asd.

Parent Component

cffi-ops (system).

Public Interface

(setf []) (setf expander).

Internals

(setf %cthe) (setf expander).


3.1.5 cffi-ops/macros.lisp

Dependencies
Source

cffi-ops.asd.

Parent Component

cffi-ops (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cffi-ops

Source

package.lisp.

Use List
  • alexandria.
  • arrow-macros.
  • cffi.
  • common-lisp.
  • trivial-macroexpand-all.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: clet (bindings &body body)

Equivalent to variable definition and initialization statements in C, but with type inference. For each element (NAME FORM) of BINDINGS, NAME is always bound to a CFFI pointer, with the following cases for different FORMs: - A variable with pointer type: NAME is directly bound to this pointer variable.
- A variable with non-pointer type: The variable is copied onto the stack semantically, and the bound pointer is pointed to it.

Package

cffi-ops.

Source

macros.lisp.

Macro: clet* (bindings &body body)

Similar to CLET, but the initialization FORM of the variable can use variables defined earlier.

Package

cffi-ops.

Source

macros.lisp.

Macro: clocally (&body body)

Similar to LOCALLY but allows using CTYPE to declare CFFI types for variables.

Package

cffi-ops.

Source

macros.lisp.

Macro: csetf (&rest args)

Equivalent to assignment statements in C, which assign the rvalue of each pair to the lvalue. Note that both the lvalues and rvalues are represented as CFFI pointers here, and the assignment operation is actually a memory copy.

Package

cffi-ops.

Source

macros.lisp.

Macro: cthe (ctype form)

Similar to THE, but declares the CFFI type for FORM.

Package

cffi-ops.

Source

macros.lisp.


5.1.2 Setf expanders

Setf Expander: (setf []) (pointer &optional index)
Package

cffi-ops.

Source

setf.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *macro-environment*
Package

cffi-ops.

Source

walker.lisp.

Special Variable: *struct-slots*
Package

cffi-ops.

Source

walker.lisp.

Special Variable: *type-dictionary*
Package

cffi-ops.

Source

walker.lisp.

Special Variable: *value-required*
Package

cffi-ops.

Source

walker.lisp.


5.2.2 Compiler macros

Compiler Macro: %cthe (ctype form)
Package

cffi-ops.

Source

walker.lisp.


5.2.3 Setf expanders

Setf Expander: (setf %cthe) (ctype form)
Package

cffi-ops.

Source

setf.lisp.

Reader

%cthe (function).


5.2.4 Ordinary functions

Function: %cthe (ctype form)
Package

cffi-ops.

Source

walker.lisp.

Setf expander for this function

(setf %cthe).

Function: body-declarations (body)
Package

cffi-ops.

Source

macros.lisp.

Function: ctypes-slots (types)
Package

cffi-ops.

Source

walker.lisp.

Function: ensure-pointer-type (type)
Package

cffi-ops.

Source

walker.lisp.

Function: expand-aref (pointer index)
Package

cffi-ops.

Source

walker.lisp.

Function: expand-form (form)
Package

cffi-ops.

Source

walker.lisp.

Function: expand-ref (form)
Package

cffi-ops.

Source

walker.lisp.

Function: expand-slot (slot form)
Package

cffi-ops.

Source

walker.lisp.

Function: form-type (form)
Package

cffi-ops.

Source

walker.lisp.

Function: memcpy (dest src n)
Package

cffi-ops.

Source

macros.lisp.

Function: pointer-type-p (type)
Package

cffi-ops.

Source

walker.lisp.


5.2.5 Generic functions

Generic Function: funcall-dynamic-extent-form (function args)
Package

cffi-ops.

Source

walker.lisp.

Methods
Method: funcall-dynamic-extent-form ((function (eql cffi:foreign-alloc)) args)
Generic Function: funcall-form-type (function args)
Package

cffi-ops.

Source

walker.lisp.

Methods
Method: funcall-form-type (function args)
Method: funcall-form-type ((function (eql cffi:foreign-alloc)) args)

Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
B   C   E   F   G   M   P   S  
Index Entry  Section

%
%cthe: Private compiler macros
%cthe: Private ordinary functions

(
(setf %cthe): Private setf expanders
(setf []): Public setf expanders

B
body-declarations: Private ordinary functions

C
clet: Public macros
clet*: Public macros
clocally: Public macros
Compiler Macro, %cthe: Private compiler macros
csetf: Public macros
cthe: Public macros
ctypes-slots: Private ordinary functions

E
ensure-pointer-type: Private ordinary functions
expand-aref: Private ordinary functions
expand-form: Private ordinary functions
expand-ref: Private ordinary functions
expand-slot: Private ordinary functions

F
form-type: Private ordinary functions
funcall-dynamic-extent-form: Private generic functions
funcall-dynamic-extent-form: Private generic functions
funcall-form-type: Private generic functions
funcall-form-type: Private generic functions
funcall-form-type: Private generic functions
Function, %cthe: Private ordinary functions
Function, body-declarations: Private ordinary functions
Function, ctypes-slots: Private ordinary functions
Function, ensure-pointer-type: Private ordinary functions
Function, expand-aref: Private ordinary functions
Function, expand-form: Private ordinary functions
Function, expand-ref: Private ordinary functions
Function, expand-slot: Private ordinary functions
Function, form-type: Private ordinary functions
Function, memcpy: Private ordinary functions
Function, pointer-type-p: Private ordinary functions

G
Generic Function, funcall-dynamic-extent-form: Private generic functions
Generic Function, funcall-form-type: Private generic functions

M
Macro, clet: Public macros
Macro, clet*: Public macros
Macro, clocally: Public macros
Macro, csetf: Public macros
Macro, cthe: Public macros
memcpy: Private ordinary functions
Method, funcall-dynamic-extent-form: Private generic functions
Method, funcall-form-type: Private generic functions
Method, funcall-form-type: Private generic functions

P
pointer-type-p: Private ordinary functions

S
Setf Expander, (setf %cthe): Private setf expanders
Setf Expander, (setf []): Public setf expanders