1 ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
3 ;;; package.lisp --- Package definition for CFFI.
5 ;;; Copyright (C) 2005-2006, James Bielman <jamesjb@jamesjb.com>
7 ;;; Permission is hereby granted, free of charge, to any person
8 ;;; obtaining a copy of this software and associated documentation
9 ;;; files (the "Software"), to deal in the Software without
10 ;;; restriction, including without limitation the rights to use, copy,
11 ;;; modify, merge, publish, distribute, sublicense, and/or sell copies
12 ;;; of the Software, and to permit persons to whom the Software is
13 ;;; furnished to do so, subject to the following conditions:
15 ;;; The above copyright notice and this permission notice shall be
16 ;;; included in all copies or substantial portions of the Software.
18 ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 ;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 ;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 ;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 ;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 ;;; DEALINGS IN THE SOFTWARE.
28 (in-package #:cl-user
)
31 (:use
#:common-lisp
#:cffi-sys
#:babel-encodings
)
32 (:import-from
#:alexandria
39 #:ignore-some-conditions
46 #:simple-style-warning
55 ;; FIXME: the following types are undocumented. They should
56 ;; probably be replaced with a proper type introspection API
58 #:*built-in-foreign-types
*
59 #:*other-builtin-types
*
60 #:*built-in-integer-types
*
61 #:*built-in-float-types
*
63 ;; Primitive pointer operations.
75 #:with-foreign-pointer
80 #:make-shareable-byte-vector
81 #:with-pointer-to-vector-data
83 ;; Foreign string operations.
84 #:*default-foreign-encoding
*
85 #:foreign-string-alloc
87 #:foreign-string-to-lisp
88 #:lisp-string-to-foreign
90 #:with-foreign-strings
91 #:with-foreign-pointer-as-string
93 ;; Foreign array operations.
94 ;; TODO: document these
97 #:foreign-array-to-lisp
98 #:lisp-array-to-foreign
102 ;; Foreign function operations.
105 #:foreign-funcall-pointer
106 #:translate-camelcase-name
107 #:translate-name-from-foreign
108 #:translate-name-to-foreign
109 #:translate-underscore-separated-name
111 ;; Foreign library operations.
112 #:*foreign-library-directories
*
113 #:*darwin-framework-directories
*
115 #:foreign-library-name
116 #:foreign-library-pathname
117 #:foreign-library-type
118 #:foreign-library-loaded-p
119 #:list-foreign-libraries
120 #:define-foreign-library
121 #:load-foreign-library
122 #:load-foreign-library-error
123 #:use-foreign-library
124 #:close-foreign-library
125 #:reload-foreign-libraries
132 ;; Foreign type operations.
138 #:define-foreign-type
139 #:define-parse-method
140 #:define-c-struct-wrapper
141 #:foreign-enum-keyword
142 #:foreign-enum-keyword-list
144 #:foreign-bitfield-symbol-list
145 #:foreign-bitfield-symbols
146 #:foreign-bitfield-value
147 #:foreign-slot-pointer
150 #:foreign-slot-offset
153 #:foreign-type-alignment
155 #:with-foreign-object
156 #:with-foreign-objects
159 #:convert-from-foreign
160 #:convert-into-foreign-memory
161 #:free-converted-object
162 #:translation-forms-for-class
164 ;; Extensible foreign type operations.
165 #:define-translation-method
; FIXME: undocumented
166 #:translate-to-foreign
167 #:translate-from-foreign
168 #:translate-into-foreign-memory
169 #:free-translated-object
170 #:expand-to-foreign-dyn
172 #:expand-from-foreign
173 #:expand-into-foreign-memory
178 #:foreign-symbol-pointer