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 #:foreign-funcall-varargs
107 #:foreign-funcall-pointer-varargs
108 #:translate-camelcase-name
109 #:translate-name-from-foreign
110 #:translate-name-to-foreign
111 #:translate-underscore-separated-name
113 ;; Foreign library operations.
114 #:*foreign-library-directories
*
115 #:*darwin-framework-directories
*
117 #:foreign-library-name
118 #:foreign-library-pathname
119 #:foreign-library-type
120 #:foreign-library-loaded-p
121 #:list-foreign-libraries
122 #:define-foreign-library
123 #:load-foreign-library
124 #:load-foreign-library-error
125 #:use-foreign-library
126 #:close-foreign-library
127 #:reload-foreign-libraries
134 ;; Foreign type operations.
140 #:define-foreign-type
141 #:define-parse-method
142 #:define-c-struct-wrapper
143 #:foreign-enum-keyword
144 #:foreign-enum-keyword-list
146 #:foreign-bitfield-symbol-list
147 #:foreign-bitfield-symbols
148 #:foreign-bitfield-value
149 #:foreign-slot-pointer
152 #:foreign-slot-offset
155 #:foreign-type-alignment
157 #:with-foreign-object
158 #:with-foreign-objects
161 #:convert-from-foreign
162 #:convert-into-foreign-memory
163 #:free-converted-object
164 #:translation-forms-for-class
166 ;; Extensible foreign type operations.
167 #:define-translation-method
; FIXME: undocumented
168 #:translate-to-foreign
169 #:translate-from-foreign
170 #:translate-into-foreign-memory
171 #:free-translated-object
172 #:expand-to-foreign-dyn
174 #:expand-from-foreign
175 #:expand-into-foreign-memory
180 #:foreign-symbol-pointer