repos
/
smoke
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
filehistory
normal
|
plain
|
shade
|
zebra
Update to the new Smoke ABI (v.3)
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.3")
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
2009-12-13 tobias
54
;; Smoke::ModuleIndex is a POD-struct.
10:17:08 '
55
;; Thus we can treat it as a C struct.
2009-04-05 tobias
56
(defcstruct smoke-module-index
15:36:29 '
57
(smoke :pointer)
'
58
(index smoke-index))
'
59
2010-02-19 tobias
60
(declaim (inline smoke-get-smoke))
2010-01-10 tobias
61
(defcfun smoke-get-smoke :pointer
2010-02-19 tobias
62
(smoke-binding smoke-binding))
21:10:24 '
63
2010-01-10 tobias
64
(defcfun smoke-get-module-name :string
2009-04-05 tobias
65
(smoke :pointer))
2009-06-22 tobias
66
12:18:08 '
67
(defcenum cl-smoke-array
'
68
:classes
'
69
:methods
'
70
:method-maps
'
71
:method-names
'
72
:types
'
73
:inheritance-list
'
74
:argument-list
'
75
:ambiguous-method-list)
'
76
'
77
(defcfun cl-smoke-array :pointer
'
78
(smoke :pointer)
'
79
(array cl-smoke-array))
'
80
'
81
(defcfun cl-smoke-array-size smoke-index
'
82
(smoke :pointer)
'
83
(array cl-smoke-array))