No need to construct a SmokeBinding per Smoke module.
Annotate for file src/libsmoke/smoke.lisp
2009-04-05 tobias 1 (in-package #:smoke)
15:36:29 ' 2
' 3 (eval-when (:load-toplevel :compile-toplevel :execute)
2010-01-10 tobias 4 (define-foreign-library libclsmoke
2010-02-17 tobias 5 (:darwin "libclsmoke.dylib")
2010-01-10 tobias 6 (:unix "libclsmoke.so")
08:49:36 ' 7 (t (:default "libclsmoke")))
' 8 (define-foreign-library libclsmokeutil
2010-02-17 tobias 9 (:darwin "libclsmokeutil.dylib")
2010-01-10 tobias 10 (:unix "libclsmokeutil.so")
08:49:36 ' 11 (t (:default "libclsmokeutil")))
' 12 (use-foreign-library libclsmoke))
2009-04-05 tobias 13
15:36:29 ' 14 (eval-when (:load-toplevel :compile-toplevel :execute)
2010-01-10 tobias 15 (use-foreign-library libclsmokeutil)
08:49:36 ' 16 (defcfun (smoke-sizeof-bool "cl_smoke_sizeof_bool") :int)
2009-04-05 tobias 17 (defun cffi-bool-type ()
15:36:29 ' 18 "Returns a cffi unsigned int type with the same size as a C++ bool."
2010-01-10 tobias 19 (load-foreign-library 'libclsmokeutil)
2009-05-11 tobias 20 (intern (format nil "UINT~A" (* 8 (smoke-sizeof-bool)))
2009-04-05 tobias 21 (find-package :keyword)))
15:36:29 ' 22
' 23 (defmacro defcxxbool ()
' 24 `(defctype cxx-bool (:boolean ,(cffi-bool-type)))))
' 25
' 26 (defcxxbool)
' 27
2010-01-10 tobias 28 ;(close-foreign-library 'libclsmokeutil)
2009-04-05 tobias 29
15:36:29 ' 30 (defctype smoke-binding :pointer
' 31 "A Smoke binding")
' 32
' 33 (defctype smoke-index :short
' 34 "An index")
' 35
2009-05-11 tobias 36 (deftype smoke-index (&optional (lower -32768) (upper 32767))
11:07:39 ' 37 "Smoke index."
' 38 `(integer ,lower ,upper))
' 39
2010-02-18 tobias 40 (defcfun (smoke-construct-binding "cl_smoke_construct_binding") smoke-binding
2009-04-05 tobias 41 (destruct :pointer)
15:36:29 ' 42 (dispatch :pointer))
' 43
2010-02-18 tobias 44 (defcfun (smoke-destruct-destruct "cl_smoke_destruct_binding") :void
2009-04-05 tobias 45 (smoke smoke-binding))
15:36:29 ' 46
2009-12-13 tobias 47 ;; Smoke::ModuleIndex is a POD-struct.
10:17:08 ' 48 ;; Thus we can treat it as a C struct.
2009-04-05 tobias 49 (defcstruct smoke-module-index
15:36:29 ' 50 (smoke :pointer)
' 51 (index smoke-index))
' 52
2010-01-10 tobias 53 (defcfun (smoke-get-module-name "cl_smoke_get_module_name") :string
2009-04-05 tobias 54 (smoke :pointer))
2009-06-22 tobias 55
12:18:08 ' 56 (defcenum cl-smoke-array
' 57 :classes
' 58 :methods
' 59 :method-maps
' 60 :method-names
' 61 :types
' 62 :inheritance-list
' 63 :argument-list
' 64 :ambiguous-method-list)
' 65
' 66 (defcfun cl-smoke-array :pointer
' 67 (smoke :pointer)
' 68 (array cl-smoke-array))
' 69
' 70 (defcfun cl-smoke-array-size smoke-index
' 71 (smoke :pointer)
' 72 (array cl-smoke-array))