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