The hu.dwim.sdl Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The hu.dwim.sdl Reference Manual

This is the hu.dwim.sdl Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 05:02:47 2022 GMT+0.

Table of Contents


1 Introduction

hu.dwim.sdl

What

It's a Common Lisp FFI for http://libsdl.org/ (SDL2).

Why

The alternative projects are partial, while this one uses cffi/c2ffi to automatically generate the complete CFFI bindings for the various subsystems of SDL2.

It only requires vanilla CFFI when used, no extra dependencies.

Who

Written by attila@lendvai.name.

Where

The primary communication channel is the facilities on the project's GitHub page.

How

This project uses CFFI/C2FFI, whose ASDF extension does two things:

  1. When needed, it can invoke c2ffi to process a C header file and emit a c2ffi spec file (a json file) that contains every detail needed to generate an FFI for a given platform. But yours truely has run this phase, and checked in the resulting spec files into the c2ffi-spec/ directory. This way users don't need to have a working c2ffi executable, nor the SDL dev headers installed.

  2. Based on the above mentioned spec file, it generates the CFFI forms into a lisp file (placed next to the spec file), and continues as if it was just another lisp file written by hand. (These lisp files could also be committed into the repo, but for now they are not, because their regeneration is automatic and painless.)

Regenerate the spec files

This should only be done when the SDL API has some new functionality that is needed on the Lisp side. Once the *.spec files got regenerated, they should be pushed into the git repo; i.e. the users of hu.dwim.sdl shouldn't need to do this normally.

On Debian

This should work, assuming that you have a working c2ffi in the path:

sudo apt-get install curl sbcl libsdl2-dev
rm -f c2ffi-spec/*.spec && ./bin/generate-spec-files.sh

On NixOS

$ nix-shell --pure
$ rm -f c2ffi-spec/*.spec && ./bin/generate-spec-files.sh

Status

It contains a complete FFI for sdl.h, sdl-gfx.h, sdl-ttf.h, and sdl-image.h. Not much has been added yet to lispify the SDL API, but the CFFI binding part is complete.


2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 hu.dwim.sdl

Common Lisp FFI wrapper for libSDL2.

Author

Attila Lendvai

License

BSD or Bugroff

Version

0.1

Defsystem Dependency

cffi/c2ffi (system).

Dependencies
  • alexandria (system).
  • cffi (system).
  • cffi/c2ffi (system).
  • cffi-libffi (system).
Source

hu.dwim.sdl.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 hu.dwim.sdl/source

Dependencies
Source

hu.dwim.sdl.asd.

Parent Component

hu.dwim.sdl (system).

Child Components

Previous: , Up: Modules   [Contents][Index]

3.2 hu.dwim.sdl/c2ffi-spec

Dependency

ffi-prelude.lisp (file).

Source

hu.dwim.sdl.asd.

Parent Component

hu.dwim.sdl (system).

Child Component

sdl.h (file).


4 Files

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


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


4.1.1 hu.dwim.sdl/hu.dwim.sdl.asd

Source

hu.dwim.sdl.asd.

Parent Component

hu.dwim.sdl (system).

ASDF Systems

hu.dwim.sdl.


4.1.2 hu.dwim.sdl/package-stage-1.lisp

Source

hu.dwim.sdl.asd.

Parent Component

hu.dwim.sdl (system).

Packages

hu.dwim.sdl.


4.1.3 hu.dwim.sdl/ffi-prelude.lisp

Dependency

package-stage-1.lisp (file).

Source

hu.dwim.sdl.asd.

Parent Component

hu.dwim.sdl (system).

Public Interface
Internals

4.1.4 hu.dwim.sdl/source/package-stage-2.lisp

Source

hu.dwim.sdl.asd.

Parent Component

source (module).

Internals

import-all-owned-symbols (function).


4.1.5 hu.dwim.sdl/source/package-stage-3.lisp

Dependency

package-stage-2.lisp (file).

Source

hu.dwim.sdl.asd.

Parent Component

source (module).


4.1.6 hu.dwim.sdl/source/sdl.lisp

Dependency

package-stage-3.lisp (file).

Source

hu.dwim.sdl.asd.

Parent Component

source (module).

Public Interface
Internals

4.1.7 hu.dwim.sdl/c2ffi-spec/sdl.h

Source

hu.dwim.sdl.asd.

Parent Component

c2ffi-spec (module).


5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 hu.dwim.sdl

Source

package-stage-1.lisp.

Use List
  • alexandria.
  • cffi.
  • common-lisp.
Public Interface
Internals

6 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Public Interface


6.1.1 Macros

Macro: c-fun/not-null (fn-name &rest args)
Package

hu.dwim.sdl.

Source

sdl.lisp.

Macro: c-fun/rc (fn-name &rest args)
Package

hu.dwim.sdl.

Source

sdl.lisp.


Next: , Previous: , Up: Public Interface   [Contents][Index]

6.1.2 Standalone methods

Method: expand-from-foreign (value (type sdl-error-code))
Package

cffi.

Source

ffi-prelude.lisp.


6.1.3 Conditions

Condition: sdl-error
Package

hu.dwim.sdl.

Source

ffi-prelude.lisp.

Direct superclasses

error.

Direct subclasses

sdl-error/negative-return-code.


6.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

6.2.1 Ordinary functions

Function: %c-fun/not-null/check-error (rc fn-name whole-form)
Package

hu.dwim.sdl.

Source

sdl.lisp.

Function: %c-fun/rc/check-error (rc fn-name whole-form)
Package

hu.dwim.sdl.

Source

sdl.lisp.

Function: ffi-name-transformer (name kind &key &allow-other-keys)
Package

hu.dwim.sdl.

Source

ffi-prelude.lisp.

Function: ffi-type-transformer (type context &rest args &key &allow-other-keys)
Package

hu.dwim.sdl.

Source

ffi-prelude.lisp.

Function: import-all-owned-symbols (source-package target-package &key overwrite)
Package

hu.dwim.sdl.

Source

package-stage-2.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

6.2.2 Generic functions

Generic Reader: error-code-of (condition)
Generic Writer: (setf error-code-of) (condition)
Package

hu.dwim.sdl.

Methods
Reader Method: error-code-of ((condition sdl-error/negative-return-code))
Writer Method: (setf error-code-of) ((condition sdl-error/negative-return-code))
Source

ffi-prelude.lisp.

Target Slot

error-code.


Next: , Previous: , Up: Internals   [Contents][Index]

6.2.3 Conditions

Condition: sdl-error/negative-return-code
Package

hu.dwim.sdl.

Source

ffi-prelude.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: error-code
Initform

(quote (error "must specify error-code."))

Initargs

:error-code

Readers

error-code-of.

Writers

(setf error-code-of).


Previous: , Up: Internals   [Contents][Index]

6.2.4 Classes

Class: sdl-error-code
Package

hu.dwim.sdl.

Source

ffi-prelude.lisp.

Direct superclasses

foreign-type-alias.

Direct methods

expand-from-foreign.

Direct Default Initargs
InitargValue
:actual-type(parse-type int)

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   E   S  
Index Entry  Section

E
error-code: Private conditions

S
Slot, error-code: Private conditions

Jump to:   E   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   H   M   P   S  
Index Entry  Section

C
c2ffi-spec: The hu․dwim․sdl/c2ffi-spec module
Class, sdl-error-code: Private classes
Condition, sdl-error: Public conditions
Condition, sdl-error/negative-return-code: Private conditions

F
ffi-prelude.lisp: The hu․dwim․sdl/ffi-prelude․lisp file
File, ffi-prelude.lisp: The hu․dwim․sdl/ffi-prelude․lisp file
File, hu.dwim.sdl.asd: The hu․dwim․sdl/hu․dwim․sdl․asd file
File, package-stage-1.lisp: The hu․dwim․sdl/package-stage-1․lisp file
File, package-stage-2.lisp: The hu․dwim․sdl/source/package-stage-2․lisp file
File, package-stage-3.lisp: The hu․dwim․sdl/source/package-stage-3․lisp file
File, sdl.h: The hu․dwim․sdl/c2ffi-spec/sdl․h file
File, sdl.lisp: The hu․dwim․sdl/source/sdl․lisp file

H
hu.dwim.sdl: The hu․dwim․sdl system
hu.dwim.sdl: The hu․dwim․sdl package
hu.dwim.sdl.asd: The hu․dwim․sdl/hu․dwim․sdl․asd file

M
Module, c2ffi-spec: The hu․dwim․sdl/c2ffi-spec module
Module, source: The hu․dwim․sdl/source module

P
Package, hu.dwim.sdl: The hu․dwim․sdl package
package-stage-1.lisp: The hu․dwim․sdl/package-stage-1․lisp file
package-stage-2.lisp: The hu․dwim․sdl/source/package-stage-2․lisp file
package-stage-3.lisp: The hu․dwim․sdl/source/package-stage-3․lisp file

S
sdl-error: Public conditions
sdl-error-code: Private classes
sdl-error/negative-return-code: Private conditions
sdl.h: The hu․dwim․sdl/c2ffi-spec/sdl․h file
sdl.lisp: The hu․dwim․sdl/source/sdl․lisp file
source: The hu․dwim․sdl/source module
System, hu.dwim.sdl: The hu․dwim․sdl system

Jump to:   C   F   H   M   P   S