The ffa Reference Manual

This is the ffa Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:06:13 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 ffa

Foreign friendly arrays

Author

Tamas K Papp

License

LLGPL

Dependencies
  • cffi (system).
  • cl-utilities (system).
  • metabang-bind (system).
  • iterate (system).
Source

ffa.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 ffa/ffa.asd

Source

ffa.asd.

Parent Component

ffa (system).

ASDF Systems

ffa.

Packages

ffa-asd.


3.1.2 ffa/package.lisp

Source

ffa.asd.

Parent Component

ffa (system).

Packages

ffa.


3.1.3 ffa/types.lisp

Dependency

package.lisp (file).

Source

ffa.asd.

Parent Component

ffa (system).

Public Interface

elt-type (function).

Internals

3.1.4 ffa/utils.lisp

Dependency

types.lisp (file).

Source

ffa.asd.

Parent Component

ffa (system).

Internals

3.1.5 ffa/pointer.lisp

Dependency

utils.lisp (file).

Source

ffa.asd.

Parent Component

ffa (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 ffa

Source

package.lisp.

Use List
  • cl-utilities.
  • common-lisp.
  • iterate.
  • metabang.bind.
Public Interface
Internals

4.2 ffa-asd

Source

ffa.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

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


5.1 Public Interface


5.1.1 Macros

Macro: with-pointer-to-array ((array pointer cffi-type size direction) &body body)

See the documentation.

Package

ffa.

Source

pointer.lisp.

Macro: with-pointers-to-arrays (parameter-lists &body body)

Same as with-pointer-to-array, but with multiple arrays, pointers, etc. parameter-lists needs to be a list of lists.

Package

ffa.

Source

pointer.lisp.


5.1.2 Ordinary functions

Function: elt-type (cffi-elt-type)

Return the Lisp array element-type matching cffi-elt-type, nil if not found.

Package

ffa.

Source

types.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *cffi-and-lisp-types*
Package

ffa.

Source

types.lisp.


5.2.2 Macros

Macro: copy-to-pointer ((array pointer cffi-type size index-offset direction) &body body)

Allocate memory area and establish desired mapping between array and pointer (copy in and/or out as needed). Array will be available at pointer, which is a local binding so you do whatever you want with it (change its value etc).

Package

ffa.

Source

pointer.lisp.

Macro: iter% (&body body)

Common iteration for all cases below. IMPORTANT: This macro captures pointer-index, size, array-index and index-offset.

Package

ffa.

Source

pointer.lisp.

Macro: pin-to-pointer ((array pointer cffi-type size index-offset) &body body)

Use SBCL’s sb-sys:with-pinned-objects and sb-ext:array-storage-vector for mapping an array to a memory location. NOTE: checking that cffi-type matches the type of the array is the responsibility of the user of this macro. The total size of the array is checked.

Package

ffa.

Source

pointer.lisp.


5.2.3 Ordinary functions

Function: complex-mem-aref (pointer part-type index)

aref workaround for C99 complex types. Part-type is NOT checked.

Package

ffa.

Source

pointer.lisp.

Function: (setf complex-mem-aref) (pointer part-type index)

setf aref workaround for C99 complex types. Part-type is NOT checked.

Package

ffa.

Source

pointer.lisp.

Function: copy-array-from-pointer (array pointer cffi-type lisp-type index-offset size)

Copy size elements to an array (starting at index-offset) of element type lisp-type from the memory area that starts at pointer, coercing the elements if necessary.

Package

ffa.

Source

pointer.lisp.

Function: copy-array-to-pointer (array pointer cffi-type lisp-type index-offset size)

Copy size elements from array (starting at index-offset) of type lisp-type to the memory area that starts at pointer, coercing the elements if necessary.

Package

ffa.

Source

pointer.lisp.

Function: displace-array (array dimensions index-offset)

Make a displaced array from array with the given dimensions and the index-offset and the same element-type as array. Tries to displace from the original array.

Package

ffa.

Source

utils.lisp.

Function: elt-type-size (cffi-elt-type)
Package

ffa.

Source

types.lisp.

Function: find-original-array (array)

Find the original parent of a displaced array, return this and the sum of displaced index offsets.

Package

ffa.

Source

utils.lisp.

Function: part-type (cffi-type)

Return the appropriate part-type if cffi-type is complex, otherwise NIL.

Package

ffa.

Source

pointer.lisp.

Function: valid-direction-p (direction)

Test if the given direction is valid.

Package

ffa.

Source

pointer.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   D   E   F   I   M   P   V   W  
Index Entry  Section

(
(setf complex-mem-aref): Private ordinary functions

C
complex-mem-aref: Private ordinary functions
copy-array-from-pointer: Private ordinary functions
copy-array-to-pointer: Private ordinary functions
copy-to-pointer: Private macros

D
displace-array: Private ordinary functions

E
elt-type: Public ordinary functions
elt-type-size: Private ordinary functions

F
find-original-array: Private ordinary functions
Function, (setf complex-mem-aref): Private ordinary functions
Function, complex-mem-aref: Private ordinary functions
Function, copy-array-from-pointer: Private ordinary functions
Function, copy-array-to-pointer: Private ordinary functions
Function, displace-array: Private ordinary functions
Function, elt-type: Public ordinary functions
Function, elt-type-size: Private ordinary functions
Function, find-original-array: Private ordinary functions
Function, part-type: Private ordinary functions
Function, valid-direction-p: Private ordinary functions

I
iter%: Private macros

M
Macro, copy-to-pointer: Private macros
Macro, iter%: Private macros
Macro, pin-to-pointer: Private macros
Macro, with-pointer-to-array: Public macros
Macro, with-pointers-to-arrays: Public macros

P
part-type: Private ordinary functions
pin-to-pointer: Private macros

V
valid-direction-p: Private ordinary functions

W
with-pointer-to-array: Public macros
with-pointers-to-arrays: Public macros


A.3 Variables