Cleanup C++ to Lisp translation
Annotate for file src/smoke-c/smoke-c.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
2009-12-13 tobias 6 (:unix "libsmokeqt.so.2")
2010-02-16 tobias 7 (t (:default "libsmokeqt")))
2009-12-13 tobias 8 #-mudballs
2010-01-10 tobias 9 (define-foreign-library libsmoke-c
08:49:36 ' 10 (:unix "libsmoke-c.so")
' 11 (t (:default "libsmoke-c")))
2009-12-13 tobias 12 #-mudballs
2010-01-10 tobias 13 (define-foreign-library libsmoke-c-util
08:49:36 ' 14 (:unix "libsmoke-c-util.so")
' 15 (t (:default "libsmoke-c-util")))
2010-02-16 tobias 16 (use-foreign-library libsmokeqt)
2010-01-10 tobias 17 (use-foreign-library libsmoke-c))
2009-04-05 tobias 18
2010-02-17 tobias 19
2009-04-05 tobias 20 (eval-when (:load-toplevel :compile-toplevel :execute)
2010-01-10 tobias 21 (use-foreign-library libsmoke-c-util)
08:49:36 ' 22 (defcfun smoke-sizeof-bool :int)
2009-04-05 tobias 23 (defun cffi-bool-type ()
15:36:29 ' 24 "Returns a cffi unsigned int type with the same size as a C++ bool."
2010-01-10 tobias 25 (load-foreign-library 'libsmoke-c-util)
2009-05-11 tobias 26 (intern (format nil "UINT~A" (* 8 (smoke-sizeof-bool)))
2009-04-05 tobias 27 (find-package :keyword)))
15:36:29 ' 28
' 29 (defmacro defcxxbool ()
' 30 `(defctype cxx-bool (:boolean ,(cffi-bool-type)))))
' 31
' 32 (defcxxbool)
' 33
2010-01-10 tobias 34 ;(close-foreign-library 'libsmoke-c-util)
2009-04-05 tobias 35
15:36:29 ' 36 (defctype smoke-binding :pointer
' 37 "A Smoke binding")
' 38
' 39 (defctype smoke-index :short
' 40 "An index")
' 41
2009-05-11 tobias 42 (deftype smoke-index (&optional (lower -32768) (upper 32767))
11:07:39 ' 43 "Smoke index."
' 44 `(integer ,lower ,upper))
' 45
2010-01-10 tobias 46 (defcfun smoke-init smoke-binding
2010-02-19 tobias 47 (smoke :pointer)
2009-04-05 tobias 48 (destruct :pointer)
15:36:29 ' 49 (dispatch :pointer))
' 50
2010-01-10 tobias 51 (defcfun smoke-destruct :void
2009-04-05 tobias 52 (smoke smoke-binding))
15:36:29 ' 53
' 54 (defcstruct smoke-module-index
' 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 :pointer
2010-02-19 tobias 60 (smoke-binding smoke-binding))
21:10:24 ' 61
2010-01-10 tobias 62 (defcfun 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))