manual: add Clasp to "Implementation Support"
[cffi.git] / src / package.lisp
blobf54c7a9f0bc0ba24d859311ef6cfaa6eabe9b0d6
1 ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; package.lisp --- Package definition for CFFI.
4 ;;;
5 ;;; Copyright (C) 2005-2006, James Bielman <jamesjb@jamesjb.com>
6 ;;;
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:
14 ;;;
15 ;;; The above copyright notice and this permission notice shall be
16 ;;; included in all copies or substantial portions of the Software.
17 ;;;
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.
26 ;;;
28 (in-package #:cl-user)
30 (defpackage #:cffi
31 (:use #:common-lisp #:cffi-sys #:babel-encodings)
32 (:import-from #:alexandria
33 #:compose
34 #:ensure-list
35 #:featurep
36 #:format-symbol
37 #:hash-table-values
38 #:if-let
39 #:ignore-some-conditions
40 #:lastcar
41 #:make-gensym-list
42 #:make-keyword
43 #:mappend
44 #:once-only
45 #:parse-body
46 #:simple-style-warning
47 #:symbolicate
48 #:unwind-protect-case
49 #:when-let
50 #:with-unique-names)
51 (:export
52 ;; Types.
53 #:foreign-pointer
55 ;; FIXME: the following types are undocumented. They should
56 ;; probably be replaced with a proper type introspection API
57 ;; though.
58 #:*built-in-foreign-types*
59 #:*other-builtin-types*
60 #:*built-in-integer-types*
61 #:*built-in-float-types*
63 ;; Primitive pointer operations.
64 #:foreign-free
65 #:foreign-alloc
66 #:mem-aptr
67 #:mem-aref
68 #:mem-ref
69 #:pointerp
70 #:pointer-eq
71 #:null-pointer
72 #:null-pointer-p
73 #:inc-pointer
74 #:incf-pointer
75 #:with-foreign-pointer
76 #:make-pointer
77 #:pointer-address
79 ;; Shareable vectors.
80 #:make-shareable-byte-vector
81 #:with-pointer-to-vector-data
83 ;; Foreign string operations.
84 #:*default-foreign-encoding*
85 #:foreign-string-alloc
86 #:foreign-string-free
87 #:foreign-string-to-lisp
88 #:lisp-string-to-foreign
89 #:with-foreign-string
90 #:with-foreign-strings
91 #:with-foreign-pointer-as-string
93 ;; Foreign array operations.
94 ;; TODO: document these
95 #:foreign-array-alloc
96 #:foreign-array-free
97 #:foreign-array-to-lisp
98 #:lisp-array-to-foreign
99 #:with-foreign-array
100 #:foreign-aref
102 ;; Foreign function operations.
103 #:defcfun
104 #:foreign-funcall
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*
114 #:foreign-library
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
127 ;; Callbacks.
128 #:callback
129 #:get-callback
130 #:defcallback
132 ;; Foreign type operations.
133 #:defcstruct
134 #:defcunion
135 #:defctype
136 #:defcenum
137 #:defbitfield
138 #:define-foreign-type
139 #:define-parse-method
140 #:define-c-struct-wrapper
141 #:foreign-enum-keyword
142 #:foreign-enum-keyword-list
143 #:foreign-enum-value
144 #:foreign-bitfield-symbol-list
145 #:foreign-bitfield-symbols
146 #:foreign-bitfield-value
147 #:foreign-slot-pointer
148 #:foreign-slot-value
149 #:foreign-slot-type
150 #:foreign-slot-offset
151 #:foreign-slot-count
152 #:foreign-slot-names
153 #:foreign-type-alignment
154 #:foreign-type-size
155 #:with-foreign-object
156 #:with-foreign-objects
157 #:with-foreign-slots
158 #:convert-to-foreign
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
171 #:expand-to-foreign
172 #:expand-from-foreign
173 #:expand-into-foreign-memory
175 ;; Foreign globals.
176 #:defcvar
177 #:get-var-pointer
178 #:foreign-symbol-pointer